[Multishop-devel] nuke_7.5/html/modules/Multishop index.php,NONE,1.1 copyright.php,NONE,1.1
Brought to you by:
tropic
From: Piero T. <tr...@us...> - 2005-02-21 16:07:28
|
Update of /cvsroot/multishop/nuke_7.5/html/modules/Multishop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16934 Added Files: index.php copyright.php Log Message: no message --- NEW FILE: copyright.php --- <?php /************************************************************************/ /* Copyright-file - Php-MultiShop */ /* ============================== */ /* */ /* This file has been created by Francisco Burzi */ /* Copyright (c) 2002 http://phpnuke.org */ /* and modified by Piero Trono: http://www.php-multishop.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. */ /************************************************************************/ /* $Id: copyright.php,v 1.1 2005/02/21 16:07:12 tropic Exp $ */ // To have the Copyright window work in your module just fill the following // required information and then copy the file "copyright.php" into your // module's directory. It's all, as easy as it sounds ;) // NOTE: in $download_location PLEASE give the direct download link to the file!!! $author_name = "Piero Trono"; $author_email = "http://php-multishop.com/contact.php"; $author_homepage = "http://www.php-multishop.com"; $license = "GNU/GPL"; $download_location = "http://www.php-multishop.com"; $module_version = "1.0"; $module_description = "Display pf shops online and setting of privacy"; // DO NOT TOUCH THE FOLLOWING COPYRIGHT CODE. YOU'RE JUST ALLOWED TO CHANGE YOUR "OWN" // MODULE'S DATA (SEE ABOVE) SO THE SYSTEM CAN BE ABLE TO SHOW THE COPYRIGHT NOTICE // FOR YOUR MODULE/ADDON. PLAY FAIR WITH THE PEOPLE THAT WORKED CODING WHAT YOU USE!! // YOU ARE NOT ALLOWED TO MODIFY ANYTHING ELSE THAN THE ABOVE REQUIRED INFORMATION. // AND YOU ARE NOT ALLOWED TO DELETE THIS FILE NOR TO CHANGE ANYTHING FROM THIS FILE IF // YOU'RE NOT THIS MODULE'S AUTHOR. function show_copyright() { global $author_name, $author_email, $author_homepage, $license, $download_location, $module_version, $module_description; if ($author_name == "") { $author_name = "N/A"; } if ($author_email == "") { $author_email = "N/A"; } if ($author_homepage == "") { $author_homepage = "N/A"; } if ($license == "") { $license = "N/A"; } if ($download_location == "") { $download_location = "N/A"; } if ($module_version == "") { $module_version = "N/A"; } if ($module_description == "") { $module_description = "N/A"; } $module_name = basename(dirname(__FILE__)); $module_name = eregi_replace("_", " ", $module_name); echo "<html>\n" ."<body bgcolor=\"#F6F6EB\" link=\"#363636\" alink=\"#363636\" vlink=\"#363636\">\n" ."<title>$module_name: Copyright Information</title>\n" ."<font size=\"2\" color=\"#363636\" face=\"Verdana, Helvetica\">\n" ."<center><b>Module Copyright © Information</b><br>" ."$module_name module for <a href=\"http://phpnuke.org\" target=\"new\">PHP-Nuke</a><br><br></center>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>Module's Name:</b> $module_name<br>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>Module's Version:</b> $module_version<br>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>Module's Description:</b> $module_description<br>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>License:</b> $license<br>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>Author's Name:</b> $author_name<br>\n" ."<img src=\"../../images/arrow.gif\" border=\"0\"> <b>Author's Email:</b> $author_email<br><br>\n" ."<center>[ <a href=\"$author_homepage\" target=\"new\">Author's HomePage</a> | <a href=\"$download_location\" target=\"new\">Module's Download</a> | <a href=\"javascript:void(0)\" onClick=javascript:self.close()>Close</a> ]</center>\n" ."</font>\n" ."</body>\n" ."</html>"; } show_copyright(); ?> --- NEW FILE: index.php --- <?php /************************************************************************/ /* Php-MultiShop */ /* http://www.php-multishop.com */ /* Copyright (c) 2003-2005 by Piero Trono */ /* ====================================== */ /* */ /* 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. */ /************************************************************************/ /* $Id: index.php,v 1.1 2005/02/21 16:07:01 tropic Exp $ */ if ( !defined('MODULE_FILE') ) { die("You can't access this file directly..."); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); get_lang($module_name); $pagetitle = "- " . _SHOPS_ONLINE; $index = 1; $name_language = "name_" . $currentlang; $name_default = "name_" . DEFAULT_LANGUAGE; $Config = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_multishop_config")); function detail_vendor(){ global $prefix, $vendors_id, $db, $language, $Config, $user, $usession; include ('header.php'); if (!$vendors_id){ OpenTable(); echo "<table width=\"100%\"><tr><td align=\"right\" width=\"25%\"> </td><td align=\"center\" width=\"50%\"><font class=\"title\"><b>" . _NOT_VENDOR_SELECTED . "</b></font></td><td align=\"right\" width=\"25%\"><a href=\"modules.php?name=Multishop&op=privacy\"><font class=\"normal\"><b>" . _PRIVACY . "</font></b></a></td></tr></table>"; CloseTable(); } else { OpenTable(); $row = $db->sql_fetchrow($db->sql_query("SELECT vendors_name, vendors_host FROM ".$prefix."_vendors WHERE vendors_id=$vendors_id")); $Row = $db->sql_fetchrow($db->sql_query("SELECT address, shop_" . $language . " , prod_" . $language . " , logo, image_shop, image_prod FROM ".$prefix."_vendors_details WHERE vendors_id=$vendors_id")); echo "<table width=\"100%\"><tr><td align=\"right\" width=\"25%\"> </td><td align=\"center\" width=\"50%\"><font class=\"title\"><b>" . $row['vendors_name'] . "</b></font><br><br>" ."<a href=\"http://$row[vendors_host]\" title=\"" . _GO_TO_SHOP . "\" target=\"_blank\"><b>" . _GO_TO_SHOP . "</b></a></td><td align=\"right\" width=\"25%\"><a href=\"modules.php?name=Multishop&op=privacy\"><font class=\"normal\"><b>" . _PRIVACY . "</font></b></a></td></tr></table><br>"; if (is_user($user) ){ $row[vendors_host] = ereg_replace("index.php","login.php?usession=$usession",$row[vendors_host]); } echo "<br><br><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\">\n"; echo "<tr><td width=\"50%\"><br><br>"; if ($Row['logo']) echo "<img src=\"images/vendors/" . $Row['logo'] . "\" border=\"0\" width=\"$Config[widht_logo]\" alt=\"$row[vendors_name]\">\n"; echo "</td><td width=\"50%\"><br><br>"; echo "<b>" . _ADDRESS . "</b><p>"; echo nl2br($Row['address']); echo "</td></tr><tr><td width=\"50%\"><br><br>"; echo "<b>" . _THE_FIRM . "</b><p>"; echo nl2br($Row['shop_' . $language]); echo "</td><td width=\"50%\"><br><br>"; if ($Row['image_shop']) echo "<img src=\"images/vendors/" . $Row['image_shop'] . "\" border=\"0\" width=\"$Config[widht_shop]\" alt=\"$row[vendors_name]\"></td></tr>\n"; echo "<tr><td width=\"50%\"><br><br>"; if ($Row['image_prod']) echo "<img src=\"images/vendors/" . $Row['image_prod'] . "\" border=\"0\" width=\"$Config[widht_prod]\" alt=\"$row[vendors_name]\"></td>\n"; echo "<td width=\"50%\"><br><br><b>" . _THE_PRODUCTION . "</b><p>"; echo nl2br($Row['prod_' . $language]); echo "</td></tr></table>"; CloseTable(); } include ('footer.php'); } function show_all_vendors(){ global $prefix, $db, $Config, $user, $usession; include ('header.php'); $result = $db->sql_query("SELECT * FROM ".$prefix."_vendors ORDER BY vendors_name"); OpenTable(); if ($db->sql_numrows($result)){ echo "<table width=\"100%\"><tr><td align=\"right\" width=\"25%\"> </td><td align=\"center\" width=\"50%\"><font class=\"title\"><b>" . _SHOPS_ONLINE . "</b></font></td><td align=\"right\" width=\"25%\"><a href=\"modules.php?name=Multishop&op=privacy\"><font class=\"normal\"><b>" . _PRIVACY . "</font></b></a></td></tr></table>"; echo "<br><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" align=\"center\">"; if (is_user($user) ){ while ($row = $db->sql_fetchrow($result)) { $Row = $db->sql_fetchrow($db->sql_query("SELECT logo FROM ".$prefix."_vendors_details WHERE vendors_id=$row[vendors_id]")); $logo = $Row['logo']; echo "<tr><td><br><br></td><td><br><br></td></tr><tr><td align=\"left\"> "; if ($logo) echo "<img src=\"images/vendors/$logo\" border=\"0\" width=\"$Config[widht_logo]\" alt=\"$row[vendors_name]\">"; echo " </td><td align=\"left\">"; echo " <font class=\"title\"><b>$row[vendors_name]</b></font><br><br>"; echo " <a href=\"modules.php?name=Multishop&op=detail_vendor&vendors_id=$row[vendors_id]\" title=\"" . _DETAILS_VENDOR . "\"><b>" . _DETAILS_VENDOR . "</b></a><br><br>\n"; $row[vendors_host] = ereg_replace("index.php","login.php",$row[vendors_host]); echo " <a href=\"http://$row[vendors_host]?usession=$usession\" title=\"" . _GO_TO_SHOP . "\" target=\"_blank\"><b>" . _GO_TO_SHOP . "</b></a>"; echo " <br><br></td></tr>"; } } else { while ($row = $db->sql_fetchrow($result)) { $Row = $db->sql_fetchrow($db->sql_query("SELECT logo FROM ".$prefix."_vendors_details WHERE vendors_id=$row[vendors_id]")); $logo = $Row['logo']; echo "<tr><td><br><br></td><td><br><br></td></tr><tr><td align=\"left\"> "; if ($logo) echo "<img src=\"images/vendors/$logo\" border=\"0\" width=\"$Config[widht_logo]\" alt=\"$row[vendors_name]\">"; echo " </td><td align=\"left\">"; echo " <font class=\"title\"><b>$row[vendors_name]</b></font><br><br>"; echo " <a href=\"modules.php?name=Multishop&op=detail_vendor&vendors_id=$row[vendors_id]\" title=\"" . _DETAILS_VENDOR . "\"><b>" . _DETAILS_VENDOR . "</b></a><br><br>\n"; echo " <a href=\"http://$row[vendors_host]\" title=\"" . _GO_TO_SHOP . "\"><b>" . _GO_TO_SHOP . "</b></a>"; echo " <br><br></td></tr>"; } } echo "</table>"; } else { echo "<table width=\"100%\"><tr><td align=\"right\" width=\"25%\"> </td><td align=\"center\" width=\"50%\"><font class=\"title\"><b>" . _SHOPS_NOT_FOUND . "</b></font></td><td align=\"right\" width=\"25%\"><a href=\"modules.php?name=Multishop&op=privacy\"><font class=\"normal\"><b>" . _PRIVACY . "</font></b></a></td></tr></table>"; } CloseTable(); include ('footer.php'); } function custom_vend($customers_id, $vendors_id){ global $prefix, $cookie, $db; $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM privacy WHERE customers_id='" . $customers_id . "' and allow_vendors_id='" . $vendors_id . "'")); if (!$db->sql_numrows($result)){ return 0; //is not present } elseif ($row['purchase'] == 1) { return 2; // have orders } else { return 1; } } function update($user){ global $prefix, $cookie, $currentlang, $multilingual, $db; if(!is_user($user)) { include("header.php"); OpenTable(); echo "<center><font class=\"title\"><b>"._NOTLOGIN."</b></font></center>\n"; CloseTable(); include("footer.php"); } elseif (is_user($user)) { cookiedecode($user); $username = $cookie[1]; $user_id = $cookie[0]; $result = $db->sql_query("SELECT vendors_id, vendors_prefix FROM ".$prefix."_vendors"); $my_sql = ""; while ($row = $db->sql_fetchrow($result)) { $var = "check_" . $row['vendors_id']; global $$var; $custom_vend = custom_vend($user_id,$row['vendors_id']); if ($$var == "on" && $custom_vend == "0"){ $db->sql_query(" INSERT INTO privacy VALUES ('". $user_id ."','". $row['vendors_id'] ."','')"); } elseif (!$$var && $custom_vend == "1"){ $db->sql_query(" DELETE FROM privacy WHERE customers_id='". $user_id ."' and allow_vendors_id ='". $row['vendors_id'] ."'"); } } Header("Location: modules.php?name=Multishop&op=privacy"); } } function privacy($user) { global $prefix, $cookie, $currentlang, $multilingual, $db; if(!is_user($user)) { include("header.php"); OpenTable(); echo "<center><font class=\"title\"><b>"._NOTLOGIN."</b></font></center>\n"; CloseTable(); include("footer.php"); } elseif (is_user($user)) { cookiedecode($user); $username = $cookie[1]; $user_id = $cookie[0]; include("header.php"); OpenTable(); echo "<table width=\"100%\"><tr><td align=\"right\" width=\"25%\"> </td><td align=\"center\" width=\"50%\"><font class=\"title\"><b>" . _PRIVACY . "</b></font></td><td align=\"right\" width=\"25%\"><a href=\"modules.php?name=Multishop\"><font class=\"normal\"><b>" . _SHOPS_ONLINE . "</font></b></a></td></tr></table>"; echo "<br>" . _MSG_HEAD_PRIVACY . ""; $result = $db->sql_query("SELECT * FROM ".$prefix."_vendors ORDER BY vendors_name"); if (!$db->sql_numrows($result)){ echo "<center><font class=\"title\"><b>" . _NOTVENDORS . "</b></font></center>\n"; } else { echo "<form name=\"form_pry\" method=\"post\" action=\"modules.php?name=Multishop\">\n"; while ($row = $db->sql_fetchrow($result)) { echo "<br><input type=\"checkbox\" name=\"check_$row[vendors_id]\" "; if (custom_vend($user_id, $row[vendors_id])) echo "checked"; echo ">". $row[vendors_name] . "\n"; } echo "<br><br><input type=\"submit\" name=\"sub\" value=\"". _SAVECHANGES . "\">\n"; echo "<input type=\"hidden\" name=\"op\" value=\"update\">\n"; echo "</form>"; } CloseTable(); include("footer.php"); } } switch($op) { case "update": update($user); privacy($user); break; case "detail_vendor": detail_vendor(); break; case "privacy": privacy($user); break; default: show_all_vendors(); break; } ?> |