>>  Site Map >>  Forums >>  Blocks 6x

Forum module - topics in forum:



Blocks 6x - Discussions regarding PHP-Nuke Blocks.



Cafepress.com affiliates block

Yaaay!

I've *finally* managed to write/ alter a php nuke block THAT WORKS!

It's based on nuke 6.9 (with or without patch), and works in the same way as the Amazon block did. (Who wrote that?)

Basically, you alter the file to put your cafepress shop id in, create the directory for your images, upload the block and associated images to the directory mentioned above.

Simple. Confused

LOL

You can see it in action on www.audifans.net - it also works in Firefox...

any issues, please let me know.

Admin;- do you want it for your downloads section? (I've not enabled downloads on audifans.net yet......)

If anyone wants it in the meantime, give me a nod Smile

Andy.






http://phpnuke-uk.net/downloads-AddDownload.html

Feel free. Smile






Cheers!

Who wrote the initial Amazon block, do we know? (Was it the bloke responsible for nuke?)- just so I make sure the copyright information is correct....






It was an Italian as far as I am aware - http://preciogasolina.com could be Spanish tho... Confused

http://preciogasolina.com/modules.php?name=Amazon






Code: :
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* 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.       */
/************************************************************************/

if (eregi("block-Amazon.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

/***************************************************************/
/* To use this block you only need to download .jpg or .gif    */
/* images from amazon.com and copy them to the /images/amazon  */
/* directory, then edit the $amazon_id variable to fit your ID */
/* of the Associates program. If you don't change the ID, all  */
/* the comissions ($) will go to my account! You're adviced.   */
/* But if you want to help PHP-Nuke project, you can leave the */
/* $amazon_id variable intact.                                 */
/*                                                             */
/* You need to know that any image in the amazon's directory   */
/* has the same ASIN name as its filename given by Amazon. If  */
/* you don't know what this is, leave it as is or disable it.  */
/***************************************************************/

$amazon_id = "phpnuke-20";

mt_srand((double)microtime()*1000000);
$imgs = dir('images/amazon');
while ($file = $imgs->read()) {
    if (eregi("gif", $file) || eregi("jpg", $file)) {
   $imglist .= "$file ";
    }
}
closedir($imgs->handle);
$imglist = explode(" ", $imglist);
$a = sizeof($imglist)-2;
$random = mt_rand(0, $a);
$image = $imglist[$random];
$asin = explode(".", $image);
$content = "<br><center><a href=\"http://www.amazon.com/exec/obidos/ASIN/$asin[0]/$amazon_id\" target=\"_blank\">";
$content .= "<img src=\"images/amazon/$image\" border=\"0\" alt=\"\"><br><br></center>";







ahh I completely forgot FB provided an Amazon Block!! - I use the one from preciogasolina - I tweaked it for UK use tho... and find it MUCH better than FB's effort






I wasn't sure if someone had used the standard Nuke Copyright info, etc. and not put theirs.... I'm using something he wrote Shocked

LOL.


It works, that's all that matters.

I'm midpoint through doing the downloads install. Once complete, I'll post it up.

Cheers.
Andy




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS