View Full Version : Lost This In 4.x upgrade - Search refresh
ajmcce
10-17-2010, 05:52 PM
i had a user defined variable set up in 3.x and the following code was in the head tag for the search results.
<if condition="$action == 'getnew'"><META HTTP-EQUIV="Refresh" CONTENT="<if condition="$bbuserinfo['field7'] != ''">$bbuserinfo[field7]<else />60</if>;URL=http://ForumsADDRESS/search.php?do=getnew"><else /></if>
<if condition="$action == 'getdaily'"><META HTTP-EQUIV="Refresh" CONTENT="<if condition="$bbuserinfo['field7'] != ''">$bbuserinfo[field7]<else />60</if>;URL=http://ForumsADDRESS/search.php?do=getdaily"><else /></if>
This has been working for years. For the life of me I cannot get it working on 4.x
What am i missing? So frustrated :-(
BirdOPrey5
10-17-2010, 08:44 PM
In VB4 the IF conditionals changed a little... they would now be:
<vb:if condition="$action == 'getnew'"><META HTTP-EQUIV="Refresh" CONTENT="<vb:if condition="$bbuserinfo['field7'] != ''">$bbuserinfo[field7]<vb:else />60</vb:if>;URL=http://ForumsADDRESS/search.php?do=getnew"><vb:else /></vb:if>
<vb:if condition="$action == 'getdaily'"><META HTTP-EQUIV="Refresh" CONTENT="<vb:if condition="$bbuserinfo['field7'] != ''">$bbuserinfo[field7]<vb:else />60</vb:if>;URL=http://ForumsADDRESS/search.php?do=getdaily"><vb:else /></vb:if>
ajmcce
10-17-2010, 08:50 PM
Thanks but I actually tried that. It appears like the action is lost on the search sharing or something. The if statement doesnt error but also doesnt trigger as true.
I had the search sharing on the 3.x site though. Should I be looking for something other than action?
BirdOPrey5
10-17-2010, 11:58 PM
Sorry I never knew/played around with actions, I just saw the conditions were wrong for 4.0...
I don't know if it's available but HTTP_Referrer (or whatever it's called) would supply the info you needed (the URL that called the page.)
ajmcce
10-18-2010, 12:18 AM
Thanks... I was looking for something with that but cant seem to put the missing pieces together.
This was one of the key features in my 3.x forums. Made a huge difference in usability and traffic.
Hoping someone here can come up with the 4.x equiv.
sigh
--------------- Added 1287436340 at 1287436340 ---------------
Still cant seem to get this to work.
Seriously regretting upgrading now :-(
ajmcce
10-22-2010, 02:06 PM
Is there a better place to ask this question? Is this a vbulletin.com question or another forum here?
BirdOPrey5
10-22-2010, 03:54 PM
I would try the VB4 forums here either general request or programming discussions. (one or the other, not both.)
--------------- Added 1287769254 at 1287769254 ---------------
I took another look at search.php and there's no reason this shouldn't work but you logic was a little tough to follow... this is simpler and should produce the same results... try it...
<vb:if condition="$action == 'getnew' AND $bbuserinfo['field7'] != ''"><META HTTP-EQUIV="Refresh" CONTENT="$bbuserinfo[field7];URL=http://ForumsADDRESS/search.php?do=getnew"></vb:if>
<vb:if condition="$action == 'getdaily' AND $bbuserinfo['field7'] != ''"><META HTTP-EQUIV="Refresh" CONTENT="$bbuserinfo[field7];URL=http://ForumsADDRESS/search.php?do=getdaily"></vb:if>
ajmcce
10-23-2010, 01:38 PM
I appreciate the ongoing effort.
This doesnt return true so nothing shows.
to be clear I am adding this to the search_resultslists template.
I also put in a comment <!--Rightplace--> above it to be absolutely sure I am in the right place.
the comment shows but nothing ever shows in the if statement.
Have you managed to get this to work on a forum where I could see it running? I would like to believe its me but it just appears the action value is being lost in the redirect to the search results page.
:-(
BirdOPrey5
10-23-2010, 02:29 PM
OK this is weird... I turned on Template Names in HTML comments (vbulletin options -> general settings) so I could see what template was being used...
I put the code into search_resultlists without the <if> conditions and it still wasn't being displayed.
Turning on the template names it revealed that when there are no new posts VB uses the "Standard Error" template not the search_resultlists template... So if you happened to have no new posts it's a different template... That code should still work if there are undread posts though... can you confirm this?
My VB4 install is just a private/test install so I can't link it, sorry.
ajmcce
10-23-2010, 03:12 PM
Yeah, interesting about the error. But I was able to get it to display on search_resultslist <!--I am here--> on that template will show that for you.
I also also go it to fire (in a broken way)
when I changed
vb:if condition="$action == 'getnew'
to
vb:if condition="$action = 'getnew'
But that just always returned true on both conditions.
Frustrating only because it continues to work happily on the 3.x forums.
Still trying. I would have to anticipate the error page issue for no new posts but only after I can get it working again on the search results when there is a positive result.
About to punt and have the new posts go to a page outside the forums that uses a frame at 100% and uses the variable passed to determine how often to refresh the whole HTML frameset.
All I would have to do is get the field5 value passed as a variable in the url for new posts.
I really dont want to go that way though. That is such a departure from the right way of doing it.
Still appreciating your interest in this solution. This was an invaluable addition to my members and my page count as well.
Lynne
11-01-2010, 10:32 PM
Did you preregister the variable $action for use in the template (or verify it is already registered)? You can't use a variable in a template unless it is registered for use.
ajmcce
11-01-2010, 10:43 PM
Interesting question.
The short answer is I dont know since this was a straight copy from 3.x
Assuming its not, what would I need to do to make it work?
Thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.