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. :)

LauraFL 02-03-2005 12:25 PM

Still not showing up at my site

Beaux 02-03-2005 01:18 PM

worked great! thanks!

zurih 02-03-2005 06:20 PM

I found a bug.
when there is no ads added in admincp, pages keep loading like they didnt loading completly... Can anyone check if they get the same bug?

interfx 02-11-2005 06:31 PM

How hard would it be add a stats module as part of this?

b00k 02-12-2005 03:37 AM

regarding this step:

Quote:

6. Open your navbar template:
Find:
==================================
<!-- / nav buttons bar -->
==================================
Add After:
==================================
$banner
==================================
OR you could place $banner anywhere else you want your banners to be shown in your template.

Save
ive gone to my navbar template, and this is what i have...
Quote:

<script type="text/javascript">
<!--
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(gray scale=1)";
if (confirm('$vbphrase[sure_you_want_to_log_out]'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}
//-->
</script>

<br />
so i search.. to add, search function fails because line looking for doesnt exist.
So, question is, how do i get this modification to work?
Where can this go ($banner) ? Ideally i want it to be in the header. Ive tried pasting it in with no success. Where should it go?

The banners i have added are showing up in the admin cP

AnhTuanCool 02-12-2005 03:48 AM

Your navbar template might be varied from mine so try to just put the $banner at the end of your navbar template see what happen and you'll figure out.

b00k 02-12-2005 03:57 AM

Quote:

Originally Posted by AnhTuanCool
Your navbar template might be varied from mine so try to just put the $banner at the end of your navbar template see what happen and you'll figure out.


ya..seems to be resolved.. i messed around with it and almost have it perfect.. works great, and in all honesty the instructions are very well done ..

thank you!!!

Stangsta 02-15-2005 05:52 AM

Quote:

Originally Posted by AnhTuanCool
Your navbar template might be varied from mine so try to just put the $banner at the end of your navbar template see what happen and you'll figure out.

My site looks like this:
http://www.sevencityracing.com/forum/index.php?

How do I center it with my logo like this site?
http://www.probe-enthusiast.com/forums/

oldfan 02-15-2005 05:19 PM

I'm also having problems centering the banner, see attached below
Could you help me out also please and thank you :)

oldfan 02-15-2005 05:39 PM

Quote:

Originally Posted by oldfan
I'm also having problems centering the banner, see attached below
Could you help me out also please and thank you :)

n/m I got it working :)
Is what http://www.probe-enthusiast.com/forums/ did a addon also?

AnhTuanCool 02-15-2005 08:06 PM

@Stangsta - Read The Post #48

@oldfan - Nop, I've never written an add-on for this mod though if you're talking about the submit form.

Stangsta 02-15-2005 11:34 PM

Quote:

Originally Posted by AnhTuanCool
@Stangsta - Read The Post #48

I did, made that change and it centered it. I don't want it centered on the page, I want it to the right of my logo but centered horizontally with it like the example in my previous post.

oldfan 02-16-2005 04:22 AM

Quote:

Originally Posted by AnhTuanCool
@Stangsta - Read The Post #48

@oldfan - Nop, I've never written an add-on for this mod though if you're talking about the submit form.

thanks, I just forwarded a link to my sendmessage.php for the time being :)
All I need now a some stats :)
[high]* oldfan clicks install[/high]

oldfan 02-16-2005 05:28 AM

Quote:

Originally Posted by AnhTuanCool
@Rastus - Did you ADD the phrase as Control Panel Stop Message phrase type? If you ain't sure then re-add it and remember to choose Control Panel Stop Message as phrase type.

@PAWS - 1. Install the Update which I attached as txt file at this thread
2. Do this:
In your forumroot/global.php
Look for the whole code you've put in your global.php and REPLACE it with
PHP Code:

// Start banner rotating by Anhtuancool
if ($vboptions['enbanners'])
{
    
// select random banner and display it
    
$getbanner $DB_site->query_first("SELECT 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 

Save, and place $banner2 in the footer or wherever you want your second banner slot to show up. :)

@LauraFL - try to install the Update txt which I attached in this thread.


I tried this and the second banner in the footer, didn't show up

oldfan 02-17-2005 12:04 AM

anyone?

AnhTuanCool 02-17-2005 08:25 PM

In the code that you inserted in global.php or simple open up global.php and look for THIS:
PHP Code:

}
// End banner 

Add ABOVE
PHP Code:

$footer .= $banner2

Save

You can use your $banner2 as a second banner in your footer now. :)

oldfan 02-18-2005 01:26 AM

Quote:

Originally Posted by AnhTuanCool
In the code that you inserted in global.php or simple open up global.php and look for THIS:
PHP Code:

}
// End banner 

Add ABOVE
PHP Code:

$footer .= $banner2

Save

You can use your $banner2 as a second banner in your footer now. :)

I'd tried that, but the banner showed up at the bottom of my page and I could move it :(

this is the code I added

Quote:

// Start banner rotating by Anhtuancool
if ($vboptions['enbanners'])
{
// select random banner and display it
$getbanner = $DB_site->query_first("SELECT 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

ajk 02-18-2005 03:26 AM

Quote:

Originally Posted by AnhTuanCool
Place $banner where you want your banners to be displayed. Make sure you remove $banner in your navbar template if you don't want it to show one banner twice at a time.

I placed the $banner in the header AND footer.
Also installed the update tutorial how to do it.

The AdminCP runs fne, but the banners won't show on the bbs.
Any ideas are appreciate. I'm still running 3.0.1.

Thanks

Freakpyromaniac 02-18-2005 10:52 PM

The system works here fine but....

I have put the $banner in the header, but it does not align to the most right side of my screen.
Between the banner and the right side of my screen are some cm blank space.
Does anyone knows how I can align de banner so it fits on the most right side of my screen?

ajk 02-18-2005 11:24 PM

Quote:

Originally Posted by Freakpyromaniac
The system works here fine but....

I have put the $banner in the header, but it does not align to the most right side of my screen.
Between the banner and the right side of my screen are some cm blank space.
Does anyone knows how I can align de banner so it fits on the most right side of my screen?

I tried it in the header and footer with the update and it won't show at all.

I have my pop up and ad blocker off too!

quachvu 02-19-2005 11:49 AM

hi ,
i am using now VBB3.0.6 and VBadvanced CMPS 1.0.1 .. how can i put this Ads on my main page portal too? under Navbar or maybe as a module ( if can be, its great) thanks!
by the way, how can i put 3 or 4 ads im the same line ? not only one. thx :)

how to fix the banner in center and midle , instead of it near the navbar like this ? http://www.vietphim.com/forum/index.php?

swantonio 02-20-2005 08:24 AM

installed optimal

http://www.clan-losmuertos.org/forum

:nervous:

ajk 02-20-2005 09:59 AM

Anybody else having problems with 3.0.1 or is it just me?

hyproVision 02-20-2005 01:10 PM

I'm confused,
where it says

Code:

2. Master switch
==================================
INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_enbanners_title', 'Enable Banners & Ads System', 5000);
INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0,  'setting_enbanners_desc', 'If this option set to Yes, overal show banners and ads on navbar function will be turned on.', 5000);

INSERT INTO setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES ('enbanners', 'general', '1', '1', 'yesno', '1000', '0', '0');
==================================

I tried running that query but i dont work, it gives me this error...

Code:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 ';
INSERT INTO phrase (languageid, varname, text, phrasetypeid)


ajk 02-20-2005 01:42 PM

Quote:

Originally Posted by hyproVision
I'm confused,
where it says

Code:

2. Master switch
==================================
INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'setting_enbanners_title', 'Enable Banners & Ads System', 5000);
INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0,  'setting_enbanners_desc', 'If this option set to Yes, overal show banners and ads on navbar function will be turned on.', 5000);

INSERT INTO setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES ('enbanners', 'general', '1', '1', 'yesno', '1000', '0', '0');
==================================

I tried running that query but i dont work, it gives me this error...

Code:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 ';
INSERT INTO phrase (languageid, varname, text, phrasetypeid)



Did you insert it into the sub category and run the query on each line seperately?

hyproVision 02-20-2005 04:20 PM

errr, nope :S
i just ran the querys from the admincp on my board

ajk 02-20-2005 05:46 PM

Quote:

Originally Posted by hyproVision
errr, nope :S
i just ran the querys from the admincp on my board

I guess that is the same thing. I do mine in phpMyAdmin.

BTW, I think mine may be a problem because I only have 3.0.1 installed.
I wish they would confirm it before I upgrade and loose my mods.

Freakpyromaniac 02-20-2005 08:40 PM

Quote:

Originally Posted by Freakpyromaniac
The system works here fine but....

I have put the $banner in the header, but it does not align to the most right side of my screen.
Between the banner and the right side of my screen are some cm blank space.
Does anyone knows how I can align de banner so it fits on the most right side of my screen?

Problem is fixed :D

ajk 02-20-2005 09:10 PM

Quote:

Originally Posted by Freakpyromaniac
Problem is fixed :D

What did you do?

I just upgraded to 3.0.7, so I hope it works NOW!

ajk 02-20-2005 11:26 PM

Hi Everyone,

Before installing this mod, I'd highly suggest backing up your board.
Install vB 3.0.7 and then happy hacking.

It does not seem to work on 3.0.1.

THANKS for a GREAT hack!
I clicked install!!!! :D


All times are GMT. The time now is 11:22 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.03429 seconds
  • Memory Usage 1,869KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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