vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Display Enhancements - Language & Styles Selectors + Google Custom Search In Navbar (https://vborg.vbsupport.ru/showthread.php?t=254356)

horussjr 11-27-2010 10:00 PM

Language & Styles Selectors + Google Custom Search In Navbar
 
1 Attachment(s)
Hello everybody! I want to present you my first mod for vbulletin, something that i was expecting to appear but it didn't happened like this. So, presenting my first mod,

Language & Styles Selectors In Navbar + Google Custom Search
Description: Duplicate Language & Styles Selectors in Navbar so you and your users can change them quicker! Also Google Custom Search! So it would appear like this:)
https://vborg.vbsupport.ru/attachmen...1&d=1290950338
BUT ALSO REMAINS HERE!!
https://vborg.vbsupport.ru/attachmen...1&d=1290950338

Installing:
STEP 1
Go to AdminCP --> Plugins & Products --> Plugin Manager --> Go to the bottom of the page and click [Add New Plugin] --> Complete the fields:
Product: LET AS DEFAULT
Hook Location: parse_templates
Title: Language & Styles Selectors In Navbar
Execution Order: LET AS DEFAULT
Plugin PHP Code:
PHP Code:

vB_Template::preRegister('navbar',array( 
'languagechooserbits' => $languagechooserbits
));  
vB_Template::preRegister('navbar',array( 
'quickchooserbits' => $quickchooserbits
)); 

Plugin is Active: Yes --> Save

STEP 2
In this step you will install both language and style mod and google custom search!!
Go to AdminCP --> Styles & Templates --> Search in Templates --> search for navbar (select your desired style to implement this mod and set yes to search titles only) --> double click the navbar template an look for:
PHP Code:

</div><!-- closing div for above_body --> 

Between that and <div class="body_wrapper"> add:
PHP Code:

<table width="100%">
<
tr><td align="left" width="50%">
    <
form action="{vb:raw vboptions.forumhome}.php" method="get" id="footer_select" class="footer_select">
    
        <
vb:if condition="$show['quickchooser']">
            <
select name="styleid" onchange="switch_id(this, 'style')">
                <
optgroup label="{vb:rawphrase quick_style_chooser}">
                    {
vb:raw quickchooserbits}
                </
optgroup>
            </
select>    
        </
vb:if>
        
        <
vb:if condition="$show['languagechooser']">
            <
select name="langid" onchange="switch_id(this, 'lang')">
                <
optgroup label="{vb:rawphrase quick_language_chooser}">
                    {
vb:raw languagechooserbits}
                </
optgroup>
            </
select>
        </
vb:if>
</
form>

</
td><td align="right" width="50%">
<
form action="http://www.google.ro/cse" id="cse-search-box">
  <
div>
    <
input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXXXXX" />
    <
input type="hidden" name="ie" value="UTF-8" />
    <
input type="text" name="q" size="25" />
    <
input type="submit" name="sa" value="Search" />
  </
div>
</
form>

<
script type="text/javascript" src="http://www.google.ro/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
</
td></tr></table

XXXXXXXXXXXXX must be replaced with your own google account numbers
For more information go to wWw.StormZone.Ro and PM user Lloyd or pm me here:)

Working on 4.0.8. Not tested on any other version. Please install and tell me :)

ENJOY!!

IF YOU WANT ONLY LANGUAGE AND THEME WITHOUT THE GOOGLE SEARCH BAR
At step 2 instead of that code add this
PHP Code:

<table width="100%">
<
tr><td align="left" width="50%">
    <
form action="{vb:raw vboptions.forumhome}.php" method="get" id="footer_select" class="footer_select">
    
        <
vb:if condition="$show['quickchooser']">
            <
select name="styleid" onchange="switch_id(this, 'style')">
                <
optgroup label="{vb:rawphrase quick_style_chooser}">
                    {
vb:raw quickchooserbits}
                </
optgroup>
            </
select>    
        </
vb:if>
        
        <
vb:if condition="$show['languagechooser']">
            <
select name="langid" onchange="switch_id(this, 'lang')">
                <
optgroup label="{vb:rawphrase quick_language_chooser}">
                    {
vb:raw languagechooserbits}
                </
optgroup>
            </
select>
        </
vb:if>
</
form>

</
td></tr>
</
table


Dr.osamA 11-29-2010 02:49 AM

installd + 5 stars
thank you

keep it up bro

Winter Sonata 11-29-2010 12:09 PM

Hello, could you please tell me how to show only the Google custom search in that place you chosen ?

Thanks

horussjr 11-29-2010 04:57 PM

give me a link to your site to see it working and the make an image obout the problem

Winter Sonata 11-29-2010 05:05 PM

Hello, there is no problem at all , I just need to show up only the search bar at the same place in your screen shot , so could you please give me the code for the Google custom search ?

Thank you for you kind support~!

horussjr 11-29-2010 05:44 PM

try with a div code like this
PHP Code:

<div align="right">
<
form action="http://www.google.ro/cse" id="cse-search-box">
  <
div>
    <
input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXXXXX" />
    <
input type="hidden" name="ie" value="UTF-8" />
    <
input type="text" name="q" size="25" />
    <
input type="submit" name="sa" value="Search" />
  </
div>
</
form>
</
div

also you can try with span like this
PHP Code:

<span align="right">
<
form action="http://www.google.ro/cse" id="cse-search-box">
  <
div>
    <
input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXXXXX" />
    <
input type="hidden" name="ie" value="UTF-8" />
    <
input type="text" name="q" size="25" />
    <
input type="submit" name="sa" value="Search" />
  </
div>
</
form>
</
span


my123world 12-03-2010 04:07 AM

Please Can Anyone Tell Me Where Is That Mod For Switching Tabs Like Shown In The ScreenShot..?

horussjr 12-03-2010 11:25 AM

what tab switching man? please, be more precise or download one of my images and mark with paint the zone and reply. maybe i can help you.

PS: if you are talking about language and theme, this is the mod:)

BadgerDog 12-03-2010 01:49 PM

Quote:

Originally Posted by horussjr (Post 2127264)
try with a div code like this
PHP Code:

<div align="right">
<
form action="http://www.google.ro/cse" id="cse-search-box">
  <
div>
    <
input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXXXXX" />
    <
input type="hidden" name="ie" value="UTF-8" />
    <
input type="text" name="q" size="25" />
    <
input type="submit" name="sa" value="Search" />
  </
div>
</
form>
</
div


Thanks horussjr ... :up:

I used this method you recommended, as I only wanted to have the extra Google Adsense Custom search added to our site, while keeping the regular vBulletin ones for those that preferred it.... :)

Seems to work great, including using Google's iFrame approach to keep search results locally displayed...

Regards,
Doug

Popa Andrei 12-03-2010 09:21 PM

i hope you dont have the same surprize as we did.Just raised 70 euros on adsense,and gues wath?they disabled the account,MF:mad:


All times are GMT. The time now is 02:44 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.01981 seconds
  • Memory Usage 1,797KB
  • 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
  • (7)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete