vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   making vBtemplates your own (https://vborg.vbsupport.ru/showthread.php?t=91270)

sabret00the 06-28-2005 09:42 PM

making vBtemplates your own
 
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
PHP Code:

    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
Code:

  Options
Showyoursignature
Quotemessageinreply?

instead of what i told it too :ermm:

the code has got to here and appears to be working now
PHP Code:

    $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
Code:

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

PHP Code:

            case "</fieldset>"

Should be:
PHP Code:

            case "</fieldset>":\ 



All times are GMT. The time now is 05:31 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
  • Page Generation 0.08656 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete