sabret00the
06-28-2005, 09:42 PM
what's the best way to go about it?
explode it into an array and then str_replace the appropriate values (i.e. quickreply would be
* do="postreply"
* name="t"
* type="text/javascript" src="
changing em into
* do="makereply"
* name="p"
* type="text/javascript" src="../forums/clientscript"
) in a foreach loop before remaking it into one big string?
Andreas
06-28-2005, 09:43 PM
I don't understand anything?
sabret00the
06-28-2005, 09:52 PM
a bit like this kirby
eval('$quickreply = "' . fetch_template('showthread_quickreply') . '";');
$quickreplyarray = explode(" ", $quickreply);
foreach ($quickreplyarray AS $key => $value)
{
switch ($value)
{
case $value = 'do="postreply"':
$newquickreply .= str_replace('do="postreply"', 'do="makereply"', $value);
break;
case $value = 'name="t"':
$newquickreply .= str_replace('name="t"', 'name="p"', $value);
break;
case $value = 'src="clientscript"':
$newquickreply .= str_replace('src="clientscript"', 'src="" . $vboptions[bburl] . "/clientscript"', $value);
break;
case $value = '</fieldset>';
$newquickreply .= str_replace('<fieldset>', '{HTML_TO_ADD_RATING_BOX}\n \n<fieldset>', $value);
break;
default:
$newquickreply .= $value;
break;
}
}
$quickreply = $newquickreply;
i'm wondering if it's efficient?
ok my bright idea never worked so brightly, it's echo'ing this Options
Showyoursignature
Quotemessageinreply?
instead of what i told it too :ermm:
the code has got to here and appears to be working now
$getquickreply = addslashes(fetch_template('showthread_quickreply') );
$quickreplyarray = explode(" ", $getquickreply);
foreach ($quickreplyarray AS $key => $value)
{
switch ($value)
{
case "do=\"postreply\"":
$newquickreply[$key] .= str_replace("do=\"postreply\"","do=\"makereply\"",$value);
break;
case "name=\"t\"":
$newquickreply .= str_replace("name=\"t\"","name=\"p\"",$value);
break;
case "src=\"clientscript\"":
$newquickreply .= str_replace("src=\"clientscript\"","src=\"" . $vboptions[bburl] . "/clientscript\"",$value);
break;
case "</fieldset>";
$newquickreply .= str_replace("<fieldset>","{HTML_TO_ADD_RATING_BOX}\n \n<fieldset>",$value);
break;
default:
$newquickreply .= $value;
break;
}
}
$quickreply = stripslashes($newquickreply);
eval($quickreply);
but it's not working cos all i get is
Parse error: syntax error, unexpected '<'
gah i thought i was soo close too, have to think about this one, any suggestions?
Marco van Herwaarden
06-29-2005, 03:39 AM
case "</fieldset>";
Should be:
case "</fieldset>":\
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.