vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Banner Rotator (Definitive Mod) **UPDATED** (https://vborg.vbsupport.ru/showthread.php?t=133954)

Koby 08-17-2007 03:05 AM

Works great, but some images upload... and then nothing shows in their place... others work just fine.

Kinda strange, checked FTP and the files are there but it wont show the banners

SpaceStar 08-17-2007 10:56 PM

Quote:

Originally Posted by WarLion (Post 1195101)
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


Great - it works fine - though this put the banner to the left hand side - remember to put CENTER for centering the banner....

} else {
$banner = "<a href='".$ban['link']."'><center><img src='" . $vbulletin->options[bburl] . $defaultdir . "/" . $ban['name'] . "' alt='" . $ban['alt'] . "' width='".$ban['width']."' height='".$ban['height']."' border='0'></center></a>";
}

websiteking532 08-18-2007 07:03 AM

what a great mod

but i got the following error when i tried to add a banner

http://upload.bz/files/zvjmr1zgnjqgnmdxjkdm.jpg

sunnycher 08-18-2007 02:27 PM

Not working, i added the GIF ext and it still wont let me upload it ?


Quote:

Originally Posted by andrefedalto (Post 1138376)
I changed a thing in the brotator.php. Please redownload the pack and replace your brotator.php that is in admincp folder for the one in the zip file. Now when you get the error that file type is not allowed, it will also show the type of the file, so you copy it, go to vBulletin Options in AdminCP, find "Banner Rotator" and then add the new extension there. That should work. If not, report here again please :)


Sorry, my mistake. Check here to see how it looks in the website:
https://vborg.vbsupport.ru/attachmen...chmentid=57595
Everytime you refresh or change the page, the banner will be replaced by other randomly.


sunnycher 08-18-2007 02:31 PM

It's not letting any of the ext upload lol!

sunnycher 08-18-2007 02:33 PM

too much of a hassle, uninstalled.

SpaceStar 08-18-2007 09:58 PM

Just experinced, if you put a question mark (?) in ALT field, it comes up with an SQL error :)

i.s.s.w 08-22-2007 12:25 PM

Nice :)

while uploading a simple banner in ext. of jpg or png it gives this

The selected file type is not allowed.

majorvbuser 08-22-2007 01:52 PM

Anybody know of a banner rotation script which allows you to actually add a URL to the banner? I don't understand what purpose a banner script is that doesn't make the banners clickable??

applyimage 08-22-2007 02:26 PM

|This error is returned when trying to upload a banner:
Code:

Warning: move_uploaded_file(./images/banners/communitybanner.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /admincp/brotator.php on line 62

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpiSUxzA' to './images/banners/communitybanner.gif' in /admincp/brotator.php on line 62

edit: uninstalled.

sorry.


All times are GMT. The time now is 03:26 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.01478 seconds
  • Memory Usage 1,836KB
  • 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_code_printable
  • (13)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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