Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2003, 02:05 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default My random problem!

I am building a new banner hack to allow targeted sponsorship of nominated forums

If a forum is sponsored the approiate banner will be displayed with link.........THIS WORKS!

However if a forum is not sponsored then a random banner is to be selected from the list....THIS IS NOT WORKING

I have added this to forumdisplay.php
PHP Code:
//############### start advertising / sponsorship banner #############
$showad $DB_site->query_first("SELECT * FROM ads WHERE forumidnum='$forumid'");
    if (empty(
$showad[forumidnum])) {
  
$randomad=$DB_site->query("SELECT * FROM ads ORDER BY rand() LIMIT 1");
  eval(
"\$showthisad .= \"".gettemplate("ads_bannerbank")."\";");
 } else {    
eval(
"\$showthisad .= \"".gettemplate("ads_forum_sponsor")."\";");

Here is the ads_bannerbank template
Code:
<center><smallfont>Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid=$randomad[id]'>
<img border='0' width='$randomad[width]' heigth='$randomad[heigth]' alt='$randomad[banner_text]'
 src='http://www.atmyparty.com/network/view.php?bannerid=$randomad[id]'></a>
<br>Please contact us to sponsor area of the site.<br><br></smallfont><center>
here is the source code of the non-sponsored page
Code:
<center><font face="verdana,arial,helvetica" size="1" >Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid='>
<img border='0' width='' heigth='' alt='' src='http://www.atmyparty.com/network/view.php?bannerid='>
</a><br>Please contact us to sponsor area of the site.<br><br></font><center>
What am i doing wrong?

thanks in advance
Reply With Quote
  #2  
Old 04-05-2003, 05:39 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok whilst I have been waiting I have been working on other areas of the hack....however i still have not been able to solve this problem yet.

I will start a new thread for my next hurdle,
I have nearly been able to complete targeting forums here the next hurdle is to target a particular script......eg....store.php

new thread here https://vborg.vbsupport.ru/showthrea...threadid=51200
Reply With Quote
  #3  
Old 04-05-2003, 06:40 PM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are you sure the cell will be empty?
PHP Code:
if (empty($showad[forumidnum])) { 
you could try
PHP Code:
if (empty($showad[forumidnum]) or $showad[forumidnum] == 0)
 { 
Reply With Quote
  #4  
Old 04-05-2003, 10:10 PM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm thanks mr e,

I actually didnt think of that....doh...but it didnt work either I even tried
PHP Code:
//############### start advertising / sponsorship banner #############
$showad $DB_site->query_first("SELECT * FROM ads WHERE forumidnum='$forumid'");
    if (empty(
$showad[forumidnum]) or $showad[forumidnum] =="") {
  
$randomad=$DB_site->query("SELECT * FROM ads ORDER BY RAND() desc LIMIT 1");
   eval(
"\$showthisad .= \"".gettemplate("ads_bannerbank")."\";");
 } else {    
eval(
"\$showthisad .= \"".gettemplate("ads_forum_sponsor")."\";");

and it didnt work either

I only have 3 banners on the table so far and they do work when a target forum is nominated eg here i have also managed to make the ad banner to appear at the top of all threads in the nominated forum as well. i have even got it to display the sponsorship in the forum list. there are 2 sponsored forums here
http://www.atmyparty.com/network/for...s=&forumid=172

I have attached a gif of the current data table, so i spose to answer your question....if you are viewing forum number 28 the cell more correctly is not there rather than empty. so by defult i want to display a random banner in the unsponsored forum/threads.

Thanks so far for your ideas...
Attached Images
File Type: gif table.gif (8.9 KB, 0 views)
Reply With Quote
  #5  
Old 04-05-2003, 10:17 PM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry but just to add to that the coding is displaying the right templates for both sponsored and unsponsored forums as the 2 templates are different....the problem is that the unsponsored forum has no image displayed.
Reply With Quote
  #6  
Old 04-06-2003, 07:23 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I may be missing something here but why are you only selecting when there is no data? Should it be like this:

PHP Code:
//############### start advertising / sponsorship banner #############
$showad $DB_site->query_first("SELECT * FROM ads WHERE forumidnum='$forumid'");
    if (!empty(
$showad[forumidnum]) or $showad[forumidnum] =="") {
  
$randomad=$DB_site->query("SELECT * FROM ads ORDER BY RAND() desc LIMIT 1");
   eval(
"\$showthisad .= \"".gettemplate("ads_bannerbank")."\";");
 } else {    
eval(
"\$showthisad .= \"".gettemplate("ads_forum_sponsor")."\";");

That's what doesn't make sense to me :s

- miSt
Reply With Quote
  #7  
Old 04-06-2003, 08:05 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HIp hip horay.........after 2 bloody days the thing works...now to work out how to target a php file

https://vborg.vbsupport.ru/showthrea...threadid=51200

then its finished!
Reply With Quote
  #8  
Old 04-06-2003, 08:36 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font size="4">THE HACK IS FINISHED!</font>

Now to get rid of phpnewads
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 10:09 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.04009 seconds
  • Memory Usage 2,272KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete