Go Back   vb.org Archive > Community Discussions > Style and Graphics Requests (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2012, 06:53 PM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Covert template vb4 to vb3

Hello ,

I have template written in vb4 and i need to convert it to vb3

PHP Code:

<style type="text/css">
                 
#seofq_list_cell *{background:none;display:inline;border:none;color:black;padding:0px 0px 0px 0px;-webkit-border-top-right-radius:0px;-webkit-border-top-left-radius:0px;-webkit-box-shadow: none;font-weight:normal;}
                 #seofq_list_cell h2{font-size: 130%;font-weight: bold;}
                 #seofq_list_cell h3{font-size: 120%;font-weight: bold;}
                 #seofq_list_cell h4{font-size: 120%;}
                 #seofq_list_cell h5{font-size: 110%;}
                 #seofq_list_cell strong{font-size: 110%;}
                 #seof_queries_list a.seoq{margin:0px 0px 0px 0px;font-size: 100%;}
                 
</style>
    <
h4 class="threadinfohead"><span class="optiontitle">{vb:rawphrase seofq_title}</span></h4>
    <
div id="seof_queries_list" class="thread_info_block">
        <
div class="inner_block">
            <
div id='seofq_list_cell'>
            <
vb:each from="keywords" key="wordid" value="word">
                {
vb:var tag_fix}{vb:var word.tag}>{vb:var word.term_value}</{vb:var word.tag}><vb:if condition="$wordid != $tagscount">,&nbsp;</vb:if>
            </
vb:each>
            </
div>
        </
div>
    </
div
Reply With Quote
  #2  
Old 02-21-2012, 01:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a problem - there is no replacement for vb:each in vb3. You would have to write a for loop in a plugin and build a string, then include the string in your template. Or if there is a limit to the number of keywords you might be able to do it with a series of <if> tags.
Reply With Quote
  #3  
Old 02-21-2012, 07:43 PM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes after i read vbulletin syntax i see that ... vb:each for foreach loop but i can not put in plugin then rebulild it

So , can you help me more with that ?

Or make modification edit and for pay ?
Reply With Quote
  #4  
Old 02-21-2012, 10:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is your template used? Do you have php code that renders your template?
Reply With Quote
  #5  
Old 02-22-2012, 07:29 AM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks kh99 for reply .. this template used in this product https://vborg.vbsupport.ru/showthread.php?t=234192 ( FUZZY SEO Booster )
Which already built-in for vb4

But i try to install it on vb 3.8.5 and work fine in admincp and appear all data and also appear search terms and i can control for all setting

BUT when i see three template which product used it i see them coded for vb4 so nothing data appear in forums pages an showthread page ( HERE THE PROBLEM )
Reply With Quote
  #6  
Old 02-22-2012, 03:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

(oops...nvm, forgot you're trying to go back to vb3).
Reply With Quote
  #7  
Old 02-22-2012, 03:54 PM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm ... and thanks for keep care for my concern ...

Any idea and soultion for converted it to VB 3.8 ...

Coder told it request only for converting temapaltes which i already write it in the first code ?
Reply With Quote
  #8  
Old 02-22-2012, 05:27 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, OK - I would start with this:

Code:
<style type="text/css"> 
                 #seofq_list_cell *{background:none;display:inline;border:none;color:black;padding:0px 0px 0px 0px;-webkit-border-top-right-radius:0px;-webkit-border-top-left-radius:0px;-webkit-box-shadow: none;font-weight:normal;} 
                 #seofq_list_cell h2{font-size: 130%;font-weight: bold;} 
                 #seofq_list_cell h3{font-size: 120%;font-weight: bold;} 
                 #seofq_list_cell h4{font-size: 120%;} 
                 #seofq_list_cell h5{font-size: 110%;} 
                 #seofq_list_cell strong{font-size: 110%;} 
                 #seof_queries_list a.seoq{margin:0px 0px 0px 0px;font-size: 100%;} 
                 </style> 
    <h4 class="threadinfohead"><span class="optiontitle">$vbphase[seofq_title]</span></h4> 
    <div id="seof_queries_list" class="thread_info_block"> 
        <div class="inner_block"> 
            <div id='seofq_list_cell'>$feosq_keywords</div> 
        </div> 
    </div>

I just changed {vb:rawphrase seofq_title} to $vbphase[seofq_title] and replaced the whole <vb:each>...</vb:each> section with $feosq_keywords, so you should be able to do the same thing to the other two templates.

Now you just need to add a section of code in the plugin to create $feosq_keywords from the keyword array. To be honest there's something a little weird going on there with the '<' character so I'm not sure what was intended, which makes it difficult to give you the correct code. But I'll take a stab at it and say in the process_templates_complete plugin, find this section:

Code:
$newTemplate = vB_Template::create( $plugin_template );
$newTemplate->register( 'keywords', $keywords );
$newTemplate->register( 'tagscount', (count($keywords)-1) );
$newTemplate->register( 'tag_fix', '<' );
$rendered = str_replace( "&lt;", "<", $newTemplate->render() );

and replace it with this:

Code:
$feosq_keywords = array();
foreach ($keywords AS $word)
{
    $feosq_keywords[] = "<$word[tag]>$word[term_value]</$word[tag]>";
}
$feosq_keywords = implode('&nbsp;', $feosq_keywords);
eval('$rendered = "' . fetch_template($plugin_template) . '";');

I can see there are other changes that need to be made in the code, but if you're in contact with the mod author then maybe he can help you with those.
Reply With Quote
  #9  
Old 02-22-2012, 06:47 PM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks ...

but this place ( process_templates_complete ) not founded in my vb 3.8.5

I think this location only founded in vb4 ??

and also i try to change plugin location to global start ot showthread star appear this error

Fatal error: Class 'vB_Template' not found in /home/forums/public_html/forum/showthread.php(112) : eval()'d code on line 106
Reply With Quote
  #10  
Old 02-22-2012, 06:54 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...try process_templates instead. But like I said, I know there are still issues that need to be addressed, such as, there's still a call to vB_Template:reRegister() which isn't in vb3.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:41 PM.


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.08622 seconds
  • Memory Usage 2,272KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete