Log in

View Full Version : GET variable from URL (plugin/conditional) !!


DrHUS
05-03-2006, 01:52 PM
Hello,
i use postbit_legacy by default on my forums, for some purpose i need to show the postbit (classic one) JUST by using Var on link
some thing like
showthread.php?t=36397&postbitstyle=classic
so thru the link above the user will show the classic postbit
other than that it will show them postbit_legacy

i do this global_start plugin (as i thought may will work) but it doesn't

if ($GLOBALS[postbitstyle] = 'classic')
{
$vbulletin->options['legacypostbit'] = 0;
}

also,
how can i make some conditional get the Var from URL

some thing like:

<if conditional="$GLOBALS[theVar] = 'ok'">
blablabla
</if>
so when some one call showthread.php?t=36397&theVar=ok
will show them the blablabla

can you help me !

antialiasis
05-03-2006, 04:08 PM
You'd need to do something like

$vbulletin->input->clean_gpc['postbitstyle'] = array('g', 'postbitstyle', TYPE_BOOL);

$vbulletin->options['legacypostbit'] = $vbulletin->GPC['postbitstyle'];

And then you'd put &postbitstyle=0 in the URL if you wanted the normal postbit and &postbitstyle=1 if you wanted the legacy postbit. If you want it to be &postbitstyle=classic, you'd have do do this instead:

$vbulletin->input->clean_gpc['postbitstyle'] = array('g', 'postbitstyle', TYPE_STR);

if ($vbulletin->GPC['postbitstyle'] == 'classic')
{
$vbulletin->options['legacypostbit'] = 0;
}

I don't know if that will work, but that's the correct version of what you were trying to do.

DrHUS
05-03-2006, 05:10 PM
Hiiiii
thank you very much for your help,

i do global_start plug-in with

$vbulletin->input->clean_gpc['postbitstyle'] = array('g', 'postbitstyle', TYPE_BOOL);

$vbulletin->options['legacypostbit'] = $vbulletin->GPC['postbitstyle'];

then i called showtheread?t=37345&postbitstyle=0

but still get the Legacy postbit :(

is there something els i have to do or i already miss?

Sorry for bumping this thread, but I really want to have this fixed. :)

i try to just plugin global_start

$vbulletin->options['legacypostbit'] = 0;
but this dosnt do any change (my defult postbit is legacy ..)
i don;t know where the problem .. can some one help on this

i really need it :(

Sorry for bumping this thread again, but I really want to have this fixed please.