Thread: Miscellaneous Hacks - Banner Rotator (Definitive Mod) **UPDATED**
View Single Post
  #68  
Old 03-21-2007, 06:43 PM
brvheart's Avatar
brvheart brvheart is offline
 
Join Date: Jul 2005
Posts: 477
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by WarLion View Post
actually i need that and i made it

find in product-rotator.xml

PHP Code:
CREATE TABLE `". TABLE_PREFIX ."banners` (
                      `
bidsmallint(20UNSIGNED NOT NULL auto_increment,
                      `
namevarchar(255NOT NULL default '',
                      `
widthvarchar(255NOT NULL default '',
                      `
heightvarchar(255NOT NULL default '',
                      `
altvarchar(255NOT NULL default '',
                      `
urlvarchar(255NOT NULL default '',
                      `
flashINT(1UNSIGNED NOT NULL default '0',
                      `
activeINT(1UNSIGNED NOT NULL default '0',
                      
PRIMARY KEY  (`bid`)
                    )
                
"); 
and remplace with this
PHP Code:
CREATE TABLE `". TABLE_PREFIX ."banners` (
                      `
bidsmallint(20UNSIGNED NOT NULL auto_increment,
                      `
namevarchar(255NOT NULL default '',
                      `
widthvarchar(255NOT NULL default '',
                      `
heightvarchar(255NOT NULL default '',
                      `
altvarchar(255NOT NULL default '',
                      `
urlvarchar(255NOT NULL default '',
                      `
linkvarchar(255NOT NULL default '',
                      `
flashINT(1UNSIGNED NOT NULL default '0',
                      `
activeINT(1UNSIGNED NOT NULL default '0',
                      
PRIMARY KEY  (`bid`)
                    )
                
"); 
then find
PHP Code:
} else {
        
$banner =     "<center><img src='" $vbulletin->options[bburl] . $defaultdir "/" $ban['name'] . "' alt='" $ban['alt'] . "' width='".$ban['width']."' height='".$ban['height']."' border='0'></center>";            
    } 
and remplace with
PHP Code:
} else {
        
$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>";            
    } 
now you need to add this about line 89
PHP Code:
<phrase name="setting_brotator_default_link_desc" date="1166036111" username="FileWarez" version="1.0b"><![CDATA[Defalt link]]></phrase
and
PHP Code:
<phrase name="setting_brotator_default_link_title" date="1166036111" username="FileWarez" version="1.0b"><![CDATA[Default link]]></phrase
save and import

now you need to edit the admincp/brotator.xml

on line 30 add this
PHP Code:
print_input_row('Link''link'$vbulletin->options['brotator_default_link']); 
find this
PHP Code:
if ($movefile) {
            
$db->query_write("INSERT INTO " TABLE_PREFIX "banners (bid, name, width, height, alt, flash, active) VALUES ('', '$fname', '$_POST[width]', '$_POST[height]', '$_POST[alt]', '$_POST[flash]', '$_POST[active]')");
            
print_cp_message($vbphrase['brotator_add_success'], "brotator.php?do=add""1");
        } else {
            
print_cp_message("There was an error while moving your file. Please retry.");
        } 
and remplace with this
PHP Code:
if ($movefile) {
            
$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[alt]', '$_POST[flash]', '$_POST[active]')");
            
print_cp_message($vbphrase['brotator_add_success'], "brotator.php?do=add""1");
        } else {
            
print_cp_message("There was an error while moving your file. Please retry.");
        } 
find this
PHP Code:
if (!empty($_POST['bid'])) {
            
$db->query("UPDATE " TABLE_PREFIX "banners SET 
                alt = '
$_POST[alt]',
                width = '
$_POST[width]',
                height = '
$_POST[height]',
                flash = '
$_POST[flash]'  
            WHERE bid = '
$_POST[bid]'");
            
print_cp_message($vbphrase['brotator_edit_desc_success'], "brotator.php?do=edit""1");
        } 
remplace with this
PHP Code:
if (!empty($_POST['bid'])) {
            
$db->query("UPDATE " TABLE_PREFIX "banners SET 
                alt = '
$_POST[alt]',
                width = '
$_POST[width]',
                height = '
$_POST[height]',
                link = '
$_POST[link]',
                flash = '
$_POST[flash]'  
            WHERE bid = '
$_POST[bid]'");
            
print_cp_message($vbphrase['brotator_edit_desc_success'], "brotator.php?do=edit""1");
        } 
find this
PHP Code:
                print_cells_row(array(
                    
"<center>".$img."</center>",
                    
"<form name='form1' method='post' action='brotator.php?do=edit'>
                    <input type='text' class='bginput' name='alt' value='
$banner[alt]' class='bginput' size='35'><br><br>
                    Width: <input type='text' class='bginput' name='width' value='
$banner[width]' class='bginput' size='5'> 
                    Height: <input type='text' class='bginput' name='height' value='
$banner[height]' class='bginput' size='5'><br><br>
                    Flash? <label for='flash"
.$banner[bid]."' class='smallfont'><input name='flash' id='flash".$banner[bid]."' type='checkbox' value='1' ".$checked."><strong>Yes</strong></label>
                    <input type='hidden' name='bid' value='
$banner[bid]'>
                    <input type='hidden' name='update' value='1'>
                    <input type='submit' name='Submit' value='  "
.$vbphrase['brotator_edit_update']."  ' class='button'>
                    </form>"
,
                    
$active 
and remplaze with this
PHP Code:
                print_cells_row(array(
                    
"<center>".$img."</center>",
                    
"<form name='form1' method='post' action='brotator.php?do=edit'>
                    <input type='text' class='bginput' name='alt' value='
$banner[alt]' class='bginput' size='35'><br>
                    Link : <input type='text' class='bginput' name='link' value='
$banner[link]' class='bginput' size='28'><br>
                    Width: <input type='text' class='bginput' name='width' value='
$banner[width]' class='bginput' size='5'> 
                    Height: <input type='text' class='bginput' name='height' value='
$banner[height]' class='bginput' size='5'><br><br>
                    Flash? <label for='flash"
.$banner[bid]."' class='smallfont'><input name='flash' id='flash".$banner[bid]."' type='checkbox' value='1' ".$checked."><strong>Yes</strong></label>
                    <input type='hidden' name='bid' value='
$banner[bid]'>
                    <input type='hidden' name='update' value='1'>
                    <input type='submit' name='Submit' value='  "
.$vbphrase['brotator_edit_update']."  ' class='button'>
                    </form>"
,
                    
$active 
save and overwrite

with this you can edit the link too
and thats all works for me on vb 3.6.4
I did that and now I get a DB error

MySQL Error : Unknown column 'link' in 'field list'
Error Number : 1054
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01307 seconds
  • Memory Usage 1,961KB
  • 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
  • (13)bbcode_php
  • (1)bbcode_quote
  • (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