PDA

View Full Version : External PHP, creates endless redirect of threads.


RivaCom
07-03-2012, 06:25 PM
I am trying to pull in a widget I had used for vbadvanced, but instead just pull it into vbulletin itself by creating a plugin. However , whenever it's enabled. No matter what thread you click, it always leads to the same thread. Below is my plugin code. If need be I can post the php code as well. Any ideas?


ob_start();
require_once('/home/rivacom/revenantgaming.com/forum/modules/slidermodule.php');
$php_include = ob_get_clean();

ob_end_clean();
vB_Template::preRegister('adv_portal',array('php_i nclude' => $php_include));

RivaCom
07-05-2012, 09:13 PM
anyone?

kh99
07-06-2012, 10:44 AM
When you say "no matter what thread you click", are you talking about clicking a thread in your slider widget? I'm not sure how we could answer your question without seeing the code, unless someone happens to be familiar with that module. (Also, unfortunately, unless it's your own code you can't post it here).

RivaCom
07-06-2012, 12:16 PM
Any thread, outside of the actually widget. So if I browse my forums, click a thread, it takes me to the same thread no matter what I click. The widget is this one.

https://vborg.vbsupport.ru/showthread.php?t=233909

Works fine as a widget for vbadvanced but once I try to use it with vbulletin using it as a plugin, I get this loop.

Lynne
07-06-2012, 04:32 PM
Can we get an actual link to be able to see the problem (see the page source).

RivaCom
07-06-2012, 06:53 PM
<a href="http://revenantgaming.com/forum/forum.php" target="_blank">http://revenantgaming.com/forum/forum.php</a>

kh99
07-06-2012, 07:11 PM
Which hook is your plugin using?

RivaCom
07-06-2012, 07:41 PM
global_start

kh99
07-06-2012, 08:03 PM
I think your problem is that the mod code uses the variable $threadid, which is supposed to get set to the thread you're trying to view (so my guess is the one thread you're always seeing is the last news thread listed). If you edit the mod code and change $threadid to something else everywhere it appears, you should fix the problem (and while you're at it you might as well change $forumid too - I'm not sure that will actually cause a problem but it's probably easier to change it than to figure out some weird problem later).

Edit: I thought of something that's easier - change your plugin code to save the values of $threadid and $forumid at the beginning and restore them when you're done. (Sorry if you already did the editing).