We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom Fields in {exp:weblog:entries /}

Development and Programming

dardar's avatar
dardar
18 posts
17 years ago
dardar's avatar dardar
Mark, I had this extension working perfectly on my local development server (MAMP) then when I migrated the ee installation / db to my mediatemple server, I am getting some weird php errors on parsing of my template. Here are the php errors that show up on the page:
Notice: strtotime(): Called with empty time parameter in /home/httpd/vhosts/surinahart.com/httpdocs/system/extensions/ext.custom_fields_in_ee_tags.php on line 203

Notice: strtotime(): Called with empty time parameter in /home/httpd/vhosts/surinahart.com/httpdocs/system/extensions/ext.custom_fields_in_ee_tags.php on line 205

I was having the same error - I think everyone should get using custom_field=”>” (NOTE: this is shows a reverse tag in editing mode) this and if notices turned on in error_reporting.

You should change this on about 204 line in ext.cutom_fields_in_ee_tags.php:

if(!is_numeric($parsed_pattern) && strtotime($parsed_pattern))
                        {
                            $test_pattern .= "'".date("U", strtotime($parsed_pattern))."'";
                        }
                        else
                        {
                            $test_pattern .= "'".$parsed_pattern."'";
                        }

with

if($parsed_pattern == "") 
                        {
                            $test_pattern .= "''";
                        }
                        elseif (!is_numeric($parsed_pattern) && @strtotime($parsed_pattern))
                        {
                            $test_pattern .= "'".date("U", @strtotime($parsed_pattern))."'";
                        }
                        else
                        {
                            $test_pattern .= "'".$parsed_pattern."'";
                        }

If you look at the code you’ll understand what it will be if $parsed_pattern is equal null

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
Well, the new feature in 1.6.1 is wonderful and similar, but it doesn’t allow for > and < comparisons.

Wondering if it would be easy to make a “stripped-down” version of Mark’s extension that only does the > and < comparisons - and use the native built-in search parameter for everything else - at least until that is assimilated in the future. Trying to save on any extra overhead. Not sure it matters - if you have to install this, you have to install it…

       
dardar's avatar
dardar
18 posts
17 years ago
dardar's avatar dardar

what is the “new feature in 1.6.1”? Is it about custom fields? Is the documentation ready?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
what is the “new feature in 1.6.1”? Is it about custom fields? Is the documentation ready?

Yeah, this is all built in now: The “search:” parameter allows you to constrain Weblog Entries output based on content within your custom fields. The only thing the native filter doesn’t do is > and <, apparently. So, for the most part you shouldn’t need this extension anymore, unless you need to do a numerical comparison.

       
tpayton's avatar
tpayton
172 posts
17 years ago
tpayton's avatar tpayton

I need some desperate help. We have a live site we just updatedfrom 1.5 to 1.6.3 and after modifying the mod.weblog.php my site is blank. Yikes!

Anyone have any luck with 1.6.3?

  • T.
       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

So, you’re still using the hack/extension even though you may not have to by just changing the entries tags to use the “search” parameter? What do you mean “luck with 1.6.3” - luck using this particular extension?

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

T. Payton, do you have error reporting enabled and display_errors “On” in the PHP environment? Sounds like a syntax error that may have occurred when modifying the file.

       
tpayton's avatar
tpayton
172 posts
17 years ago
tpayton's avatar tpayton

I apologize for the hastely written post. I was fixing code with one hand and typing with the other. I was able to use the EE search parameter to fix the site and get it up.

Concerning my question, I was curious if this extension is working with 1.6.3.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
I was able to use the EE search parameter to fix the site and get it up. Concerning my question, I was curious if this extension is working with 1.6.3.

Cool, glad to hear it. The search parameter is the bomb. I can’t speak to the extension working with 1.6.3, as I’ve never had occasion to use it. As far as I know, the only thing you might need it for is > and < (greater than/less than) comparisons.

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

Yeah, @tpayton, Ryan is correct. I don’t believe it works in 1.6.3 mainly because EE’s absorbed just about all the functionality into native features now. The only thing missing is the grater than and less than comparisons, which can probably just be done with SQL queries when needed.

       
Qrat's avatar
Qrat
40 posts
16 years ago
Qrat's avatar Qrat
Yeah, @tpayton, Ryan is correct. I don’t believe it works in 1.6.3 mainly because EE’s absorbed just about all the functionality into native features now. The only thing missing is the grater than and less than comparisons, which can probably just be done with SQL queries when needed.

Thing missing is the grater than and less than comparisons

{exp:weblog:entries custom_field=">100239320"}{title}{/exp:weblog:entries}
  {!-- any entry where custom_field is greater than 100239320 --}

and unfortunately, this extension doesn’t work with 1.6.3

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Qrat - you don’t really NEED this extension to work with 1.6.3, is sort of the point of the last couple posts. Why can’t you just use the built in weblog:entries “search” parameter? The greater/less thans can be done with the Query module.

       
Rayman's avatar
Rayman
4 posts
16 years ago
Rayman's avatar Rayman

Hi Mark, all,

It seems like functionality breaks when using

show_expired="yes"

in your exp:weblog:entries tag.

Can anybody confirm this? I’m trying to use this extension to filter various types of recorded messages, all of which are expired entries. I’m working around it by removing the end date on the entries, but if this is something that is worthy of a fix it would be terrific.

Many thanks for all of your contributions, Mark – wow!

Matt

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Again, you don’t really need this extension anymore. Why can’t you just use the built-in “search” parameter for weblog:entries tags? Unless I’m missing what you’re trying to search for.

       
Rayman's avatar
Rayman
4 posts
16 years ago
Rayman's avatar Rayman

Thanks Ryan. I’m actually locked into a 1.5.2 install, which is why I’m using this at all. I went ahead and used categories as a workaround today, so it’s not a critical thing (Mark, if you’re reading this – no need to reply).

Thanks for your input, though!

       
First 13 14 15 16

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.