![]() |
Parsing values in phrases
How do you parse values in phrases? I'd like to get the userid. In the phrase searchnoresults When doing a finduser if there are no results I added in the phrase to go somewhere else but I can't get the userid
PHP Code:
|
Not quite sure if I understand what you're trying to do. Want to add a variable to a phrase which will be parsed and replaced with a userid?
You could use for example sprintf() PHP Code:
|
Quote:
what do i put in phrase? |
%d - This will be replaced with the second argument of the sprintf() function. (If numeric in this case)
http://us2.php.net/manual/en/function.sprintf.php |
Well thank you but that does not work. I tried many options.
Basically what I want to do is when someone does a search to find all posts by a user, I altered the searchnoresults phrase with a link to redirect them somewhere else. So one thing I tried to simplify it was PHP Code:
I also tried {%d} and {1} |
Okay, I get you now. Try this.
PHP Code:
Example. PHP Code:
|
Thanks again... but that does not work.
I also tried to put $vbphrase PHP Code:
|
You have to define the vriable userid first.
PHP Code:
|
It is defined
|
Weird. This is how I tested it.
PHP Code:
Code:
Sorry - no matches. Please try some different terms. Is the source in the clean_array_gpc() function set right? (First argument) g = $_GET p = $_POST r = $_REQUEST |
I think that my problem is that I am putting them at the wrong place
I am putting them at that section in search.php where they have 2 instances of that eval. PHP Code:
|
I see what you mean. I'm having the same problem trying to do what you're saying. I found a way around it.
Place this line: PHP Code:
Under this PHP Code:
And then use this instead to display the error. PHP Code:
|
Yes that works perfect. I really appreciate the help. Thanks a lot.
|
All times are GMT. The time now is 11:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|