Thread: Miscellaneous Hacks - Banner Rotator (Definitive Mod) **UPDATED**
View Single Post
  #159  
Old 08-26-2007, 06:12 AM
WarLion's Avatar
WarLion WarLion is offline
 
Join Date: Jun 2006
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi how
wow long time this mod is not updated ok for the intersted i been workin a little bit in this hack the last time was for the mod for url and this time is for choose the target opcion i meant _self, _blank _top etc.

remenber you need to have the last mod with the link opction post 57 and then you can do this one.

for this you need to edit two files one is Product-brotator.xml and brotator.php

lets start with product-brotator.xml
you need to find this line
Code:
`link` varchar(255) NOT NULL default '',
and add below
Code:
`target` varchar(20) NOT NULL default '',
find
Code:
$banner =     "<a href='".$ban['link']."><img src='" . $vbulletin->options[bburl] . $defaultdir . "/" . $ban['name'] . "' alt='" . $ban['alt'] . "' width='".$ban['width']."' height='".$ban['height']."' border='0'></a>";            
    }
and remplase with
Code:
$banner =     "<a href='".$ban['link']."' target='".$ban['target']."'><img src='" . $vbulletin->options[bburl] . $defaultdir . "/" . $ban['name'] . "' alt='" . $ban['alt'] . "' width='".$ban['width']."' height='".$ban['height']."' border='0'></a>";            
    }
and save it

you can upload the xml with admincp- >products & plugins-> add / import product-> and allow the overwrite if you already have it

now lets start with brotatos.php

find
Code:
$defaultdir = str_replace(".", "", $vbulletin->options['brotator_default_dir']);
add below
Code:
$target_options = array(
			_self => _self,
			_blank => _blank,
			_parent => _parent,
			_top => _top,
			);
find
Code:
print_input_row('Link', 'link', $vbulletin->options['brotator_default_link']);
add below
Code:
print_select_row('Target', 'target', $target_options, _self);
find
Code:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "banners (bid, name, width, height, link,, alt, flash, active) VALUES ('', '$fname', '$_POST[width]', '$_POST[height]', '$_POST[link]', '$_POST[target]', '$_POST[alt]', '$_POST[flash]', '$_POST[active]')");
			print_cp_message($vbphrase['brotator_add_success'], "brotator.php?do=add", "1");
and remplace width
Code:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "banners (bid, name, width, height, link, target, alt, flash, active) VALUES ('', '$fname', '$_POST[width]', '$_POST[height]', '$_POST[link]', '$_POST[target]', '$_POST[alt]', '$_POST[flash]', '$_POST[active]')");
			print_cp_message($vbphrase['brotator_add_success'], "brotator.php?do=add", "1");
find this
Code:
link = '$_POST[link]',
add below
Code:
target = '$_POST[target]',
find
Code:
Height: <input type='text' class='bginput' name='height' value='$banner[height]' class='bginput' size='5'><br><br>
add below
Code:
Target :<select name='target' onChange='MM_jumpMenu('parent',this,0)' class='bginput'>
  					  <option>'$banner[target]'</option>
					  <option>_self</option>
  					  <option>_blank</option>
   					 <option>_parent</option>
   					 <option>_top</option>
 					 </select>&nbsp;
save it and upload to your server, if everithis go rigth you will have someting like this one

Code:
http://img142.imageshack.us/img142/488/addfc6.png
http://img142.imageshack.us/img142/4914/edithj1.png
all credits go to andrefedalto

i don put the files cuz al are in spanish lol i will try to upload after i translate back.


and i have a new idea i will make to choose the alig give me more ideas do you like <div> or <table>, <center> what do you like more?
i will made the modifficaccion and a complite new product to upload
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01205 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (15)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete