vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Banners & Ads System (https://vborg.vbsupport.ru/showthread.php?t=74621)

Rastus 01-31-2005 01:52 AM

Ok... thanks I have it working now. I just switched from phpBB to Vbulletin and there are couple of minor differences in the control panel. :smoke:

thanks for your help :D

LauraFL 01-31-2005 01:59 AM

I have done the update. It is still not working for me.

PAWS 01-31-2005 02:32 AM

Thanks for the reply but I get this error now:

Invalid SQL: SELECT title, html, url, type, status, width, height FROM banners WHERE status = '1' AND adid != ORDER BY RAND() LIMIT 1
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY RAND() LIMIT 1' at line 1

mysql error number: 1064

AnhTuanCool 01-31-2005 03:33 AM

Ok, sorry for the inconvenience, please do this,
Select the whole thing you've added, REPLACE by this
PHP Code:

// Start banner rotating by Anhtuancool
if ($vboptions['enbanners'])
{
    
// select random banner and display it
    
$getbanner $DB_site->query_first("SELECT adid, title, html, url, type, status, width, height FROM " TABLE_PREFIX "banners WHERE status = '1' ORDER BY RAND() LIMIT 1");
    
    eval(
'$banner = "' fetch_template('banner') . '";');
    
$avoidid $getbanner['adid'];
    unset(
$getbanner);

    
// select random banner and display it secplace
    
$getbanner $DB_site->query_first("SELECT title, html, url, type, status, width, height FROM " TABLE_PREFIX "banners WHERE status = '1' AND adid != $avoidid ORDER BY RAND() LIMIT 1");
    
    eval(
'$banner2 = "' fetch_template('banner') . '";');
    unset(
$getbanner);
}
// End banner 

Thanks,

PAWS 01-31-2005 02:49 PM

Awesome work, thank you very much! :)

Rastus 01-31-2005 06:11 PM

the banners look fine in IE, but not in Firefox. here's a link http://www.texas4x4.org/index.php

zurih 01-31-2005 06:44 PM

just a quicktip: to save 1 query on every page

Open global.php
FIND 'phpinclude_end',

Below ADD
'banner',

:)

AnhTuanCool 01-31-2005 08:20 PM

@PAWS - you're welcome ;)

@Rastus - I looked your forum source code and I figured out that you want the banners to be centered. So you changed the default banner template a bit but you somehow missed and it just 'goes out of bound' :) If you want the banner to be center aligned, do this,
REPLACE your banner template with this
[html]
<!-- Banner Rotation by AnhTuanCool -->
<div class="smallfont" align="center">
<if condition="$getbanner[type] == 1">
<a href="$getbanner[url]" target="_blank"><img src="$getbanner[html]" width="$getbanner[width]" height="$getbanner[height]" alt="$getbanner[title]" border="0" align="center" /></a>
<else />
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="$getbanner[width]" HEIGHT="$getbanner[height]" CODEBASE="http://active.macromedia.com/flash6/cabs/">
<PARAM NAME="MOVIE" VALUE="$getbanner[html]">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="true">
<PARAM NAME="QUALITY" VALUE="high">
<embed src="$getbanner
HTML Code:

" width="$getbanner[width]" height="60" play="true" loop="true" quality="high" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
                </OBJECT>
        </if>
</div>
<!-- Banner Rotation by AnhTuanCool -->

Save ;)

@zurih - thanks much for the tip, I'll consider adding it for the next version. Thanks, :)

Beaux 02-01-2005 05:07 PM

Hey AnhTuanCool,
I'm a real rookie to PHP but I'm really excited about this mod. I'm was clipping along fine until i ran into step 5. I'm confused as to what to do. Do I make a new file with nothing else? If so, does it matter what I name it? Does this go into a specific file ( I don't see any file name).

Thanks for the hack and for your help.

Here is the instruction I'm confused with:


5. Add New Template

Title: banner

Template:

==================================

<!-- Banner Rotation by AnhTuanCool -->

<div class="smallfont" style="float:left">

<if condition="$getbanner[type] == 1">

<a href="$getbanner[url]" target="_blank"><img src="$getbanner[html]" width="$getbanner[width]" height="$getbanner[height]" alt="$getbanner[title]" border="0"/></a>

<else />

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="$getbanner[width]" HEIGHT="$getbanner[height]" CODEBASE="http://active.macromedia.com/flash6/cabs/">

<PARAM NAME="MOVIE" VALUE="$getbanner[html]">

<PARAM NAME="PLAY" VALUE="true">

<PARAM NAME="LOOP" VALUE="true">

<PARAM NAME="QUALITY" VALUE="high">

<embed src="$getbanner[html]" width="$getbanner[width]" height="60" play="true" loop="true" quality="high" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>

</OBJECT>

</if>

</div>

<!-- Banner Rotation by AnhTuanCool -->

==================================

AnhTuanCool 02-01-2005 08:05 PM

I get what you say, here is how you Add New Template

Get in your AdminCP > Style Manager > Click on the drop-down menu next to the style title and cho Add New Template (see attachment for detail) and do as I described in the instruction. :)


All times are GMT. The time now is 01:45 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.01239 seconds
  • Memory Usage 1,750KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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