Weer een vraagje > Banner Mod

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
XintraX
Berichten: 50
Lid geworden op: 25 nov 2004, 20:36

Weer een vraagje > Banner Mod

Bericht door XintraX » 29 nov 2004, 23:45

Heb de mod geinstalleerd maar heb enkele rare bugs op probs

heb de pagina's gelinkt naar een andere website,nu hoe kan ik die in een blanke openen?
Heb al in de tpl file met

Code: Selecteer alles

target="_blank"
en ik zet er dus http:// voor dus snap ik het niet goed

geprobeerd maar tevergeefs

dan 2

als ik door het forum surf veranderd de banner wel
MAAR na bv 3 stappen ver in het forum te gaan
bv

>testsubforum
>>test
>>>en dan hier de post

bij die laatste word mijn forum plots breder??

te bekijken op http://www.dutchcartuning.com

mvg

Code: Selecteer alles

############################################################## 
## MOD Title: Random banners
## MOD Author: RCTycooner < tom.wuyts@a-d-e.net > (Tom Wuyts) http://www.wuyts.org/tom/phpbb2/ 
## MOD Description: If you have more then one banner, you can let them show up randomly with this.
## MOD Version: 2.1.2
## 
## Installation Level: Easy 
## Installation Time: 5 Minutes 
## Files To Edit: 	page_header.php, overall_header.tpl
##			
## Included Files: 	admin_banner.php, 
##			lang_banner.php, 
##			banner_db_update.php, 
##			banner_config_body.tpl, 
##			200to211_db_update.php
############################################################## 
## For Security Purposes, Please Check: http://www.wuyts.org/tom/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, RCTycooner will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.wuyts.org/tom/ 
############################################################## 
## Author Notes: 
##	Remember to read and execute the notes found beneath!
##	If you do not understand the explanation, please go to
##	< http://www.wuyts.org/tom/phpbb2/ > and ask your question in the 'phpbb support' forum
## 
############################################################## 
## MOD History: 
## 
##   2004-10-14 - Version 2.1.2
##	- Fixed another typo :{ in admin_banner.php ...
##   2004-09-20 - Version 2.1.1
##	- Fixed a typo in admin_banner.php
##   2004-07-29 - Version 2.1.0
##	- Admin can now define a link on each banner.
##   2003-12-16 - Version 2.0.0
##	- rewritten the code totally
##	- admin-configurable !!
##	- use of language
##   2003-11-15 - Version 1.1.0
##	- use of database
##   2003-11-10 - Version 1.0.0 
##      - First Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#
#
#-----[ COPY ]------------------------------------------ 
# remember to upload the lang_banner.php file into each language-folder you use!
# and upload banner_config_body.tpl to each template you use!

copy admin_banner.php to root/admin/admin_banner.php
copy lang_banner.php to root/language/xxx/lang_banner.php
copy banner_config_body.tpl to root/template/xxx/admin/banner_config_body.tpl

#
#-----[ RUN ]------------------------------------------ 
# upload, run and delete if finished
# NOTE: do this with the file (200to210_db_update.php) if you're updating from v2.0.0

banner_db_update.php

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
#

// 
// The following assigns all _common_ 

#
#----------------[ BEFORE, ADD ]-------------------------------- 
#

// -----------------------------------------------------------------
// RaNdOm BaNnEr mod by RCTycooner
//count the amount of banners:
$sql = "SELECT id, creator, path, url, url_hover FROM phpbb_random_banners";
if(! ($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not get banners info!!", "", __LINE__, __FILE__, $sql);
}
$banner_row = array();
while( $row = $db->sql_fetchrow($result) )
{
	$banner_row[] = $row;
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_banner.' . $phpEx);
//count the amount of banners:
$number_banners = count($banner_row);
//select a banner:
$newrand = rand(0,$number_banners-1);
$banner_result = $newrand;
//show data of resulting banner:
$banner_info = $lang['created_by'] . $banner_row[$banner_result]['creator'];
$banner_path = $banner_row[$banner_result]['path'];
$banner_url = $banner_row[$banner_result]['url'];
$banner_url_alt = $banner_row[$banner_result]['url_hover'];
// end RaNdOm BaNnEr mod by RCTycooner
// -----------------------------------------------------------------

#
# ----------------[ FIND ]-------------------------------- 
#

                'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, 
   		'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 

#
#----------------[ AFTER, ADD ]-------------------------------- 
#

	'BANNER_INFO' => $banner_info,
	'BANNER_PATH' => $banner_path,
	'BANNER_URL' => $banner_url, 
	'BANNER_ALT' => $banner_url_alt, 

#
#----------------[ OPEN ]-------------------------------- 
#

templates/xxx/overall_header.php 

#
# ----------------[ FIND ]-------------------------------- 
# the place where the banner is located; 
#  I don't know how this looks like in other styles...
# ----------------[ REPLACE, WITH ]-------------------------------- 
#
    <a href="{BANNER_URL}"> 
      <img src="{BANNER_PATH}" border="0" alt="{BANNER_ALT}" title="{BANNER_ALT}" /> 
    </a> 
   <font size="gensmall"> 
      &nbsp; &nbsp;{BANNER_INFO}. &nbsp; 
   </font> 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 30 nov 2004, 09:11

Code: Selecteer alles

    <a href="{BANNER_URL}" target="_blank"> 
      <img src="{BANNER_PATH}" border="0" alt="{BANNER_ALT}" title="{BANNER_ALT}" /> 
    </a> 
   <span class="gensmall"> 
      &nbsp; &nbsp;{BANNER_INFO}. &nbsp; 
   </span>
Naast het toevoegen van het target heb ik ook een andere fout uit de code gehaald, die eerder ongeldig was en dus niet werkt.
... Maar ik modereer (nog) niet.

XintraX
Berichten: 50
Lid geworden op: 25 nov 2004, 20:36

Bericht door XintraX » 30 nov 2004, 11:07

bee schreef:

Code: Selecteer alles

    <a href="{BANNER_URL}" target="_blank"> 
      <img src="{BANNER_PATH}" border="0" alt="{BANNER_ALT}" title="{BANNER_ALT}" /> 
    </a> 
   <span class="gensmall"> 
      &nbsp; &nbsp;{BANNER_INFO}. &nbsp; 
   </span>
Naast het toevoegen van het target heb ik ook een andere fout uit de code gehaald, die eerder ongeldig was en dus niet werkt.
dus deze code meot het doen?
ga ik eens proberen :bier:

XintraX
Berichten: 50
Lid geworden op: 25 nov 2004, 20:36

Bericht door XintraX » 30 nov 2004, 11:47

ok dat werkt
dit heb ik er wel uit gedaan

Code: Selecteer alles

<span class="gensmall">
      &nbsp; &nbsp;{BANNER_INFO}. &nbsp;
   </span>
maar ik krijg nog altijd bij de 3 de stap een breder forum :?

ik snap het niet. die banner info verschijnt volgens mij erachter
moet ik die dan in de php file ook verwijderen?

XintraX
Berichten: 50
Lid geworden op: 25 nov 2004, 20:36

Bericht door XintraX » 30 nov 2004, 11:54

Code: Selecteer alles

<?php
/***************************************************************************
 *                           	admin_banner.php
 *                            --------------------
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   copyright (C) 2003/2004  RCTycooner
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   http://www.gnu.org/copyleft/gpl.html
 *
 ***************************************************************************/

define('IN_PHPBB', 1);

if(	!empty($setmodules) )
{
	$file = basename(__FILE__);
	$module['General']['Random Banners'] = $file;
	return;
}

//
// Lets set the root dir for phpBB
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_banner.' . $phpEx);
//
//check for userlevel
//
if( !$userdata['session_logged_in'] )
{
	header('Location: ' . append_sid("login.$phpEx?redirect=admin/admin_banner.$phpEx", true));
}

if( $userdata['user_level'] != ADMIN )
{
	message_die(GENERAL_MESSAGE, $lang['no_access']);
}
//end check

if( $_POST['update'] == $lang['Update'] )
{ //update an existing banner
	//get all data:
	$sql = "SELECT id, creator, path, url, url_hover FROM ".$table_prefix."random_banners WHERE id='".$_POST['banner_id']."'";
	if(! ($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Could not obtain banner-info!!", "", __LINE__, __FILE__, $sql);
	}
	while ($row = $db->sql_fetchrow($result))
	{
	 	$current_creator = $row['creator'];
		$current_path = $row['path'];
		$current_url = $row['url'];
		$currnet_alt = $row['url_hover'];
	}

	if( $_POST['creator'] != $current_creator )
	{
		$sql = "UPDATE ".$table_prefix."random_banners SET creator='".$_POST['creator']."' WHERE id='".$_POST['banner_id']."'";
		if(! ($result = $db->sql_query($sql)) )	{ message_die(GENERAL_ERROR, "Could not update banner-info!!", "", __LINE__, __FILE__, $sql); }
	}
	if( $_POST['path'] != $current_path )
	{
		$sql2 = "UPDATE ".$table_prefix."random_banners SET path='".$_POST['path']."' WHERE id='".$_POST['banner_id']."'";
		if(! ($result2 = $db->sql_query($sql2)) )	{ message_die(GENERAL_ERROR, "Could not update banner-info!!", "", __LINE__, __FILE__, $sql2); }
	}
	if( $_POST['url'] != $current_url )
	{
		$sql2 = "UPDATE ".$table_prefix."random_banners SET url='".$_POST['url']."' WHERE id='".$_POST['banner_id']."'";
		if(! ($result2 = $db->sql_query($sql2)) )	{ message_die(GENERAL_ERROR, "Could not update banner-info!!", "", __LINE__, __FILE__, $sql2); }
	}
	if( $_POST['alt'] != $current_alt )
	{
		$sql2 = "UPDATE ".$table_prefix."random_banners SET url_hover='".$_POST['alt']."' WHERE id='".$_POST['banner_id']."'";
		if(! ($result2 = $db->sql_query($sql2)) )	{ message_die(GENERAL_ERROR, "Could not update banner-info!!", "", __LINE__, __FILE__, $sql2); }
	}
	$overall = '
	<table width="100%" cellpadding="4" cellspacing="1" border="0">
	  <tr>
		<th width="50%"  class="thHead" colspan="2"><center>'.$lang['Done'].'</center></th>
	  </tr>
	  <tr>
		<td class="row1" width="100%">'.$lang['Updated'].'<b><a href="'.append_sid("admin_banner.$phpEx").'">'.$lang['return'].'</a></b></td>
	  </tr>
	</table>';
}
else if( $_POST['delete'] == $lang['Remove'] )
{
	$sql = "DELETE FROM ".$table_prefix."random_banners WHERE id='".$_POST['banner_id']."'";
	if(! ($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Could not remove banner!!", "", __LINE__, __FILE__, $sql);
	}
	$overall = '
	<table width="100%" cellpadding="4" cellspacing="1" border="0">
	  <tr>
		<th width="50%"  class="thHead" colspan="2"><center>'.$lang['Done'].'</center></th>
	  </tr>
	  <tr>
		<td class="row1" width="100%">'.$lang['Updated'].'<b><a href="'.append_sid("admin_banner.$phpEx").'">'.$lang['return'].'</a></b></td>
	  </tr>
	</table>';
}
else if( $_POST['new'] == $lang['Add'] )
{ //add a new banner:
	//get the id of this new banner:
		//count all previous ones:
		$sql = "SELECT id"
			."		FROM ".$table_prefix."random_banners";
		if(! ($count_banners = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, "Could not count amount of banners!!", "", __LINE__, __FILE__, $sql);
		}
		$number_banners = $db->sql_numrows($count_banners);
		$newid = $number_banners + 1;
	//end getting new id
	if( ($_POST['creator'] != '' ) || ($_POST['path'] != '') ) 
	{
		$sql = "INSERT INTO ".$table_prefix."random_banners(id,creator,path, url, url_hover) VALUES ('".$newid."', '".$_POST['creator']."', '".$_POST['path']."', '".$_POST['url']."', '".$_POST['alt']."')";
		if ( !($db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not insert new banner!!', '', __LINE__, __FILE__, $sql); }
	}
	$overall = '
	<table width="100%" cellpadding="4" cellspacing="1" border="0">
	  <tr>
		<th width="50%"  class="thHead" colspan="2"><center>'.$lang['Done'].'</center></th>
	  </tr>
	  <tr>
		<td class="row1" width="100%">'.$lang['Updated'].'<b><a href="'.append_sid("admin_banner.$phpEx").'">'.$lang['return'].'</a></b></td>
	  </tr>
	</table>';

}
else //normal page
{
	//get all data:
	$sql = 'SELECT id, creator, path, url, url_hover FROM '.$table_prefix.'random_banners';
	if(! ($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Could not obtain banner-info!!", "", __LINE__, __FILE__, $sql);
	}
	//show current banners:
	$overall = '
			<table width="100%" cellpadding="4" cellspacing="1" border="0">
				<tr>
					<th class="thHead" colspan="2"><center>'.$lang['current'].'</center></th>
				</tr>';
	$number_banners = $db->sql_numrows($result);
	//check if there are banners:
	if( $number_banners == '0' )
	{
	    $overall .= '<tr><td class="row1">'.$lang['no_banner'].'</td><td class="row2"></td></tr>';
	}
	else
	{
		$banner_row = array();
		while ($row = $db->sql_fetchrow($result))
		{
		 	$banner_row[] = $row;
		}
		for ($i=0; $i < $number_banners; $i++)
		{
			//now, add for each banner next part:
			$overall .= '<tr><td><form method="post" action="'.append_sid('admin_banner.'.$phpEx).'"><table>';
			$overall .= '<tr><th class="thHead" colspan="2"><center>'.$lang['modify1'] . $banner_row[$i]['id'] . $lang['modify2'].'</center></th></tr>';
			$overall .= '<tr><td class="row2" width="50%">'.$lang['Creator'].'</td><td class="row3" width="50%"><input type="text" name="creator" value="'.$banner_row[$i]['creator'].'" size="75"></td></tr>';
			$overall .= '<tr><td class="row2" width="50%">'.$lang['Path'].'<font size="small">'.$lang['Path_exp'].'</font></td><td class="row3" width="50%"><input type="text" name="path" value="'.$banner_row[$i]['path'].'" size="75"></td></tr>';
			$overall .= '<tr><td class="row2" width="50%">'.$lang['Url'].'</td><td class="row3" width="50%"><input type="text" name="url" value="'.$banner_row[$i]['url'].'" size="75"></td></tr>';
			$overall .= '<tr><td class="row2" width="50%">'.$lang['Alt'].'</td><td class="row3" width="50%"><input type="text" name="alt" value="'.$banner_row[$i]['url_hover'].'" size="75"></td></tr>';
			$overall .= '<input type="hidden" name="banner_id" value="'.$banner_row[$i]['id'].'">';
			$overall .= '<tr><td class="row1" width="100%"><input type="submit" name="update" value="'.$lang['Update'].'"> &nbsp; &nbsp;';
			$overall .= '<input type="submit" name="delete" value="'.$lang['Remove'].'"></td></tr>';
			$overall .= '</table></form></td></tr>';
		}
	}
	//now, show the rows for adding a banner:
	$overall .= '<tr><td><form method="post" action="'.append_sid('admin_banner.'.$phpEx).'"><table>';
	$overall .= '<tr><th class="thHead" colspan="2"><center>'.$lang['add_banner'].'</center></th></tr>';
	$overall .= '<tr><td class="row1" width="50%">'.$lang['Creator'].'</td><td class="row2" width="50%"><input type="text" name="creator" value="" size="75"></td></tr>';
	$overall .= '<tr><td class="row1" width="50%">'.$lang['Path'].'<font size="small">'.$_lang['Path_exp'].'</font></td><td class="row2" width="50%"><input type="text" name="path" value="" size="75"></td></tr>';
	$overall .= '<tr><td class="row1" width="50%">'.$lang['Url'].'</td><td class="row2" width="50%"><input type="text" name="url" value="" size="75"></td></tr>';
	$overall .= '<tr><td class="row1" width="50%">'.$lang['Alt'].'</td><td class="row2" width="50%"><input type="text" name="alt" value="" size="75"></td></tr>';
	$overall .= '<tr><td class="row3" width="100%"><input type="submit" name="new" value="'.$lang['Add'].'"></td></tr>';
	$overall .= '</table></form></td></tr>';
	
	$overall .= '</table>';
}

$template->assign_vars(array(
	'OVERALL' => $overall,
	'TTL' => 'Random Banners-Configuration',
	'DESC' => 'Define here all Banner-info.',
));
$template->set_filenames(array(
	'body' => 'admin/banner_config_body.tpl')
);
//
// Generate the page
//
$template->pparse('body');

include('page_footer_admin.' . $phpEx);


?>

XintraX
Berichten: 50
Lid geworden op: 25 nov 2004, 20:36

Bericht door XintraX » 30 nov 2004, 18:56

en al iemand gechecked? :oops:

Gesloten