Author |
Message |
Agent001Fox
Hangin' Around

Joined: Dec 17, 2003
Posts: 29
Location: Stockholm - Sweden
|
Posted:
Sun Aug 29, 2004 12:57 am |
|
Does anyone know a good module or block that can show various links/ads/affiliates at the same time? I want the links to be seen as images. |
|
|
|
 |
64bitguy
The Mouse Is Extension Of Arm

Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Sun Aug 29, 2004 1:22 am |
|
hmmmm..
How about this:
Code:<?php
/***********************************************************************************/
/* Scrolling Block for links and/or images */
/* Written for PHP-Nuke by Steph Benoit (http://64bit.us) */
/* Copyright 2004, All rights reserved */
/* 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; version 2 of the License. */
/***********************************************************************************/
/* Additional Security & Abstraction Layer Conversion */
/* Performed by Chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if (eregi("block-ScrollingLinks.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die("You cannot access this file directly...");
}
//Remove then next two lines to stop the scrolling
$content = "";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"150\" scrollamount= \"2\" scrolldelay= \"10\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= "<a href=\"http://whatever.com\">Description</a>";
$content .= "<br>";
$content .= "<a href=\"http://whatever.com\">Descripton</a>";
/* Just repeat that for as many links as you want. */
/* To add an image use $content .= "<img src=\"path to image here\" border=\"0\" alt=\"\"> */
/* Don't use large images or your block will not align correctly */
?>
|
Edit where appropriate.
Save that file as block-ScrollingLinks.php |
_________________ Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance.
Last edited by 64bitguy on Sun Aug 29, 2004 3:00 am; edited 1 time in total |
|
|
 |
Agent001Fox

|
Posted:
Sun Aug 29, 2004 2:39 am |
|
Thanx for the fast reply!
The block seems very intresting, but I can't get it to work with:
Code:$content .= "<a href="http://www.double.se/reports/click.php?a=370&p=2&g=42"><img src="http://www.swedis.se/fox/media/images/pcspelbanner.jpg" border=0 alt="PCspel.com - JOIN THE GAME!"></a>";
|
It returns me the error:
Code:Parse error: parse error, unexpected T_STRING in /customers/swedis.se/swedis.se/httpd.www/blocks/block-ScrollingLinks.php on line 17
|
Any idea what to put there instead??? |
|
|
|
 |
64bitguy

|
Posted:
Sun Aug 29, 2004 4:14 am |
|
Code:<?php
/***********************************************************************************/
/* Scrolling Block for links and/or images */
/* Written for PHP-Nuke by Steph Benoit (http://64bit.us) */
/* Copyright 2004, All rights reserved */
/* 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; version 2 of the License. */
/***********************************************************************************/
/* Additional Security & Abstraction Layer Conversion */
/* Performed by Chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if (eregi("block-ScrollingLinks.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die("You cannot access this file directly...");
}
//Remove then next two lines to stop the scrolling
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"150\" scrollamount= \"2\" scrolldelay= \"10\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= "<center><a href=\"http://www.double.se/reports/click.php?a=370&p=2&g=42\"><img src=\"http://www.swedis.se/fox/media/images/pcspelbanner.jpg\" border=0 alt=\"PCspel.com - JOIN THE GAME!\"></a><br>";
/* Just repeat that for as many links as you want. */
/* To add an image use $content .= "<img src=\"path to image here\" border=\"0\" alt=\"\"> */
/* Don't use large images or your block will not align correctly */
?>
|
I would get my hands on that image and resize it to be a tad smaller, then save it on your server somewhere and change the path to it appropriately but if it looks okay using your theme, you can leave it the way it is. |
Last edited by 64bitguy on Sun Aug 29, 2004 4:21 am; edited 1 time in total |
|
|
 |
Agent001Fox

|
Posted:
Sun Aug 29, 2004 4:21 am |
|
That worked!!!
Thanx!!!!!  |
|
|
|
 |
Agent001Fox

|
Posted:
Sun Aug 29, 2004 4:36 am |
|
I discovered that the link doesn't open in a parent window, and trying to add TARGET="_blank" only messed up everything again. Probably I put it in the wrong place.
Help...???  |
|
|
|
 |
64bitguy

|
Posted:
Sun Aug 29, 2004 4:48 am |
|
Code:<?php
/***********************************************************************************/
/* Scrolling Block for links and/or images */
/* Written for PHP-Nuke by Steph Benoit (http://64bit.us) */
/* Copyright 2004, All rights reserved */
/* 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; version 2 of the License. */
/***********************************************************************************/
/* Additional Security & Abstraction Layer Conversion */
/* Performed by Chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if (eregi("block-ScrollingLinks.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die("You cannot access this file directly...");
}
//Remove then next two lines to stop the scrolling
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"150\" scrollamount= \"2\" scrolldelay= \"10\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= "<a href=\"http://www.double.se/reports/click.php?a=370&p=2&g=42\" target=\"_blank\" ><img src=\"http://www.swedis.se/fox/media/images/pcspelbanner.jpg\" border=0 alt=\"PCspel.com - JOIN THE GAME!\"></a><br>";
/* Just repeat that for as many links as you want. */
/* To add an image use $content .= "<img src=\"path to image here\" border=\"0\" alt=\"\"> */
/* Don't use large images or your block will not align correctly */
?>
|
|
|
|
|
 |
Agent001Fox

|
Posted:
Sun Aug 29, 2004 4:59 am |
|
Worked great!!!
Thanx again!!!  |
|
|
|
 |
-ShadowZ-
New Member


Joined: Sep 18, 2004
Posts: 4
|
Posted:
Fri Oct 01, 2004 5:32 pm |
|
~~new to php~~
How would i get this script 2 scroll? "Last Seen" user block
Code:
global $cookie, $prefix, $currentlang, $dbi, $username, $numusers;
$prefix = "nuke";
$numusers = 21;
if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
include("language/lastseen/lastseen-$currentlang.php");
}
else {
include("language/lastseen/lastseen-english.php");
}
ty ty (i've tried a few things, i think i'm putting scroll code in wrong spot or sumthin stupid)
$username = $cookie[1];
sql_query("CREATE TABLE IF NOT EXISTS $prefix"._lastseen." (id INT (15) not null AUTO_INCREMENT, username TEXT not null, date INT(15) not null, ip CHAR(50), PRIMARY KEY (id), UNIQUE (id))", $dbi);
if (isset($username)) {
$ip = getenv("REMOTE_HOST");
if (empty($ip)) {
$ip = getenv("REMOTE_ADDR");
}
$result = sql_query("SELECT * FROM $prefix"._lastseen." WHERE username = \"$username\"", $dbi);
if (sql_num_rows($result, $dbi) > 0) {
sql_query("UPDATE $prefix"._lastseen." SET date = " . time() . " WHERE username = \"$username\"", $dbi);
} else {
sql_query("INSERT INTO $prefix"._lastseen." VALUES (\"\", \"$username\", ".time().", \"".$ip."\")", $dbi);
}
}
$content = "";
$result = sql_query("SELECT username, date FROM $prefix"._lastseen." ORDER BY date DESC limit $numusers", $dbi);
while (list($uname, $date) = sql_fetch_row($result, $dbi)) {
if ($uname != $username) {
$realtime = time() - $date;
$dont = false;
// how many days ago?
if ($realtime >= (60*60*24*2)) { // if it's been more than 2 days
$days = floor($realtime / (60*60*24));
$dont = true;
} else if ($realtime >= (60*60*24)) { // if it's been less than 2 days
$days = 1;
$realtime -= (60*60*24);
}
if (!$dont) {
// how many hours ago?
if ($realtime >= (60*60)) {
//$content .= " ($realtime) ";
$hours = floor($realtime / (60*60));
$realtime -= (60*60*$hours);
}
// how many minutes ago?
if ($realtime >= 60) {
$mins = floor($realtime / 60);
$realtime -= (60*$mins);
}
// just a little precation, although I don't *think* mins will ever be 60...
if ($mins == 60) {
$mins = 0;
$hours += 1;
}
}
$myresult = sql_query("select user_id from nuke_users where (username='$uname')", $dbi);
list($uid) = sql_fetch_row($myresult, $dbi);
$content .= "<font class=tiny><a href=\"forums.html?file=profile&mode=viewprofile&u=".$uid."\">".$uname."</a>:";
if ($dont) {
$content .= " ".$days." "._LASTSEENDAYS."";
} else {
if ($days > 0) {
$content .= " ".$days." "._LASTSEENDAY."".(($hours == 0 && $mins == 0)?(""):(","));
}
if ($hours > 0) {
$content .= " ".$hours." ".(($hours > 1)?(""._LASTSEENHOURS.""):(""._LASTSEENHOUR."")).(($mins == 0)?(""):(","));
}
if ($mins > 0) {
$content .= " ".$mins." ".(($mins > 1)?(""._LASTSEENMINUTES.""):(""._LASTSEENMINUTE.""))."";
} else { // less than a minute :)
$content .= " ".$realtime." "._LASTSEENSECONDS."";
}
}
$content .= " "._LASTSEENAGO."</font><br>";
$days = 0;
$hours = 0;
$mins = 0;
$dont = false;
}
}
$content .= "";
?>
|
|
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sat Oct 09, 2004 3:30 pm |
|
|
|
 |
|