The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problem with php-direct "hello world" reading arguments
I have a php direct eval page but have problems after 4.0.7 update.
Functionally, the code depends on this line, which is not working: PHP Code:
Now, it returns nothing, $mystring is empty. Does anyone have a suggestion how to make this work? Workarounds? I have also tried this syntax: PHP Code:
A slightly longer version with the cycle of what the page does is here; it has a form with a drop-down posting values to itself: PHP Code:
A long version with my full code is here; https://vborg.vbsupport.ru/showthread.php?t=250920 But the key to the problem is the first line here, so the longer version may just be confusing... Please help! My vb-coding experience is low, I'm depending on you guys..... |
#2
|
||||
|
||||
This should do the trick
PHP Code:
|
#3
|
|||
|
|||
Thanks deceptor,
I have found that the problem is a caching problem. All the time the cache refresh time has been set to zero but still old content is displayed, also even if the POST arguments are changed. I remember now that I had the caching problem when I originally wrote the first code, but it was solved by setting caching to zero for the vB content. But this seems to be back now. I can read the argument once, after saving the code, but then that result "sticks" enen after a page refresh. So if the page is read first time without arguments, then none are read until some time has passed. Can I codewise explicitly disable caching? With your syntax I am getting: Fatal error: Call to a member function clean_array_gpc() on a non-object in <url>phpeval.php(97) : eval()'d code on line 1 Can you confirm this syntax works with a 4.0.7? Something wrong with my vb installation? This also works, no error message, but with the caching problem: PHP Code:
|
#4
|
||||
|
||||
Deceptor just forgot the vB:: , otherwise they are the same.
There is a bug with cache set to 0. The fix is posted in the bug report over in Jira. |
#5
|
|||
|
|||
Thanks Lynne,
Before reading your post I made a bug report http://tracker.vbulletin.com/browse/VBIV-9336 I found your solution suggested here: http://www.vbulletin.com/forum/showt...e+refresh+time and the bug tracker here http://tracker.vbulletin.com/browse/VBIV-8082 However, it did not work for me. I tried the suggested code changes, flushed the CMS cache several times, even re-started Apache. I also tried other more drastic code changes in execphp.php like: PHP Code:
PHP Code:
Also this does not work for me: ACP => Options => Add No-Cache HTTP Headers => Help Cookies and HTTP Header Options = yes This works perfectly but of course degrades the site performance: ACP => Options => Server Settings and Optimization Options =>Disable Content Caching I tested mostly with this one-line php direct evaluation code PHP Code:
So any ideas on what I can do? |
#6
|
||||
|
||||
Actually, I was thinking about the wrong thing above. Your code isn't in a widget which is the bug report I was thinking of. So, changing the cache code in the widget isn't going to help you out at all.
|
#7
|
|||
|
|||
Ah, the "execphp.php" looked right to me.
I can see there is a /packages/vbcms/content/phpeval.php which has two suspect lines: on line 60: PHP Code:
PHP Code:
I tried setting these to zero but that did not help |
#8
|
||||
|
||||
To be honest, I don't know. I really don't know much about the caching in the CMS.
|
#9
|
|||
|
|||
For now, I am running the site all un-cached, working acceptably. It's on a dedicated server and is not heavily loaded. I can keep it that way until I see what comes out of the bug report / Jira....
http://www.41hz.com/forums/content.php?253-TSdb |
#10
|
|||
|
|||
This is just a hack, but I had to solve this problem ASAP and here's what I did... I basically turned off rendering a cached page for direct PHP eval pages, which honestly if I'm using the eval pages it's likely b/c the content is dynamically being created so I don't want to use a cached page anyway.
On line 60 of packages/vbcms/item/content/phpeval.php: // if ($preview_only OR $this->rendered['rendered_text']) if ($preview_only) That's it. Keep in mind, this hack will be overwritten by future upgrades, but hopefully vb will have the issue resolved by then. Hope this helps get you running today though! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|