ZyRoBoT
Mitglied
Registriert: 02.09.2008
Beiträge: 2
|
|
Hallo leute ich hab eine toplist script Aardvark Topsites installiert und im moment sehr erfolgreich. Aber ich kann keine werbung über button.php mit javascript in anderen seite machen. Bei viellen toplist seiten hab ich gesehen das denen banner sich automatisch ändert und erscheint einen anderen bild mit anderem werbung-link. Sowas möchte ich auch machen aber leider weiss ich nicht wie ich javascript in button.php einbinden soll die benutzer fügen bei sich in Ihrem seite
<a href="http://www.toplistdomain.com"><img src="http://www.toplistdomain.com/button.php?u=benutzerName" alt="Toplist Domain.com" border="0" /></a>
unter dem code möchte auch javascript übermitteln der button.php sieht so aus
<?php //===========================================================================\\ // Aardvark Topsites PHP 5.2 \\ // Copyright (c) 2000-2007 Jeremy Scheff. All rights reserved. \\ //---------------------------------------------------------------------------\\ // http://www.aardvarktopsitesphp.com/ http://www.avatic.com/ \\ //---------------------------------------------------------------------------\\ // 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. \\ //===========================================================================\\
// Help prevent register_globals injection define('ATSPHP', 1); $CONF = array(); $FORM = array(); $TMPL = array();
// Change the path to your full path if necessary $CONF['path'] = '.';
// Connect to the database require_once("{$CONF['path']}/settings_sql.php"); require_once("{$CONF['path']}/sources/sql/{$CONF['sql']}.php");
$DB = "sql_{$CONF['sql']}"; $DB = new $DB; $DB->connect($CONF['sql_host'], $CONF['sql_username'], $CONF['sql_password'], $CONF['sql_database']);
// Settings $settings = $DB->fetch("SELECT * FROM {$CONF['sql_prefix']}_settings", __FILE__, __LINE__); $CONF = array_merge($CONF, $settings);
// Check id for backwards compatability with 4.x if (isset($_GET['id']) && $_GET['id'] && !isset($_GET['u'])) { $username = $DB->escape($_GET['id']); } else { $username = $DB->escape($_GET['u']); }
// Is this a valid member? If not, exit to stop leechers list($test) = $DB->fetch("SELECT active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$username}'", __FILE__, __LINE__); if (!$test && (isset($_GET['u']) || isset($_GET['id']))) { exit; }
// Is this a unique hit? $ip = $DB->escape($_SERVER['REMOTE_ADDR'], 1); list($ip_sql, $unq_pv) = $DB->fetch("SELECT ip_address, unq_pv FROM {$CONF['sql_prefix']}_ip_log WHERE ip_address = '$ip' AND username = '{$username}'", __FILE__, __LINE__);
$unique_sql = ', unq_pv_overall = unq_pv_overall + 1, unq_pv_0_daily = unq_pv_0_daily + 1, unq_pv_0_weekly = unq_pv_0_weekly + 1, unq_pv_0_monthly = unq_pv_0_monthly + 1'; if ($ip == $ip_sql && $unq_pv == 0) { $DB->query("UPDATE {$CONF['sql_prefix']}_ip_log SET unq_pv = 1 WHERE ip_address = '{$ip}' AND username = '{$username}'", __FILE__, __LINE__); } elseif ($ip != $ip_sql) { $DB->query("INSERT INTO {$CONF['sql_prefix']}_ip_log (ip_address, username, unq_pv) VALUES ('{$ip}', '{$username}' ,1)", __FILE__, __LINE__); } else { $unique_sql = ''; }
// Update stats $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET tot_pv_overall = tot_pv_overall + 1, tot_pv_0_daily = tot_pv_0_daily + 1, tot_pv_0_weekly = tot_pv_0_weekly + 1, tot_pv_0_monthly = tot_pv_0_monthly + 1{$unique_sql} WHERE username = '{$username}'", __FILE__, __LINE__);
// What button to display? $rank_on_button = 0; if ($CONF['ranks_on_buttons']) { // See if rank is freshly cached. If so, use cached value. If not, calculate rank. list($rank_cache, $rank_cache_time) = $DB->fetch("SELECT rank_cache, rank_cache_time FROM {$CONF['sql_prefix']}_stats WHERE username = '{$username}'", __FILE__, __LINE__);
$current_time = time(); if ($current_time - (12*3600) < $rank_cache_time) { if ($rank_cache > 0 && $rank_cache <= $CONF['button_num']) { $rank = $rank_cache; $location = "{$CONF['button_dir']}/{$rank}.{$CONF['button_ext']}"; $rank_on_button = 1; } } else { require_once "{$CONF['path']}/sources/misc/classes.php"; $rank_by = base::rank_by();
list($hits) = $DB->fetch("SELECT {$rank_by} FROM {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats WHERE sites.username = stats.username AND active = 1 AND sites.username = '{$username}'", __FILE__, __LINE__); if ($hits) { list($rank) = $DB->fetch("SELECT count(*) FROM {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats WHERE sites.username = stats.username AND active = 1 AND ({$rank_by}) >= $hits", __FILE__, __LINE__);
$new_rank_cache = 0; if ($rank <= $CONF['button_num']) { $location = "{$CONF['button_dir']}/{$rank}.{$CONF['button_ext']}"; $rank_on_button = 1;
$new_rank_cache = $rank; } } if ($new_rank_cache) { $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET rank_cache = {$new_rank_cache}, rank_cache_time = {$current_time} WHERE username = '{$username}'", __FILE__, __LINE__); } }
// Stat Buttons if ($CONF['ranks_on_buttons'] == 2) { require_once "{$CONF['path']}/settings_buttons.php"; exit; } }
$DB->close();
if (!$rank_on_button) { $location = $CONF['button_url']; }
header("Location: {$location}"); ?>
|
Ich weiss jetzt nicht genau ob man unter button.php javascript einbinden soll keine ahnung aber ich vermute mal.
meine javascript code sieht so aus
var currentdate = 0; var core = 0; function initArray() {
this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++) { this[i] = initArray.arguments[i]; } }
link = new initArray( "http://www.ads.domain1.net/", "http://www.ads-domain2.com/", "http://www.ads-domain3.org/" );
image = new initArray( "http://www.ads-domain1.net/ads.gif", "http://www.ads-domain2.com/ads.gif", "http://www.ads-domain3.org/ads.gif" );
text = new initArray( "Werbung 1", "Werbung 2", "Werbung 3" ); var currentdate = new Date(); var core = currentdate.getSeconds() % image.length; var ranlink = link[core]; var ranimage = image[core]; var rantext = text[core];
document.write('<a title="'+rantext+'" target="new" href=\"' +ranlink+ ' \">.</a>');
|
der javascript ist ist unter ads.js gespeichert. Ich möchte das der javascript mit der code was die benutzer einfügen in ihrem seite zusammen startet sobald der unten stehende code gerufen wird.
<a href="http://www.toplistdomain.com"><img src="http://www.toplistdomain.com/button.php?u=benutzerName" alt="Toplist Domain.com" border="0" /></a>
Javascript hab ich irgend in einem seite gefunden und finde sehr schön ausser leider das der keine timer hat das die banner sich alle 3-5 sekunde automatisch ändern. :(
Bitte um hilfeeee.
Danke jetzt schon für euren hilfe auch wenns nicht raus kommen sollte.
Beitrag geändert von ZyRoBoT (02.09.2008 21:00:42)
|
|