Main Menu
Quick Links
Other Options
Information
NukeForums
Top10 Links
Site Visitors
Membership:
Latest: carlosmafud
Today: 0
Yesterday: 1
Overall: 15026
Visitation:
Guests: 407
Members: 0
Total: 407
You are Anonymous user. You can register for free by clicking here
Sponsor Links
NukeResources :: View topic - SELECTION SWITCHING PROBLEM.
SELECTION SWITCHING PROBLEM.
Posted: Fri Oct 14, 2005 11:04 am
bbaros
Resourceful
Joined: Jul 03, 2005
Posts: 81
Location: Nashville, TN
I am having a difficult time trying to make a page switch over from one to another. Here is the code i have so far. and the URL at which i am using the code on. can someone PLEASE help me on having it where it switches over from one product catalog to the next?
THANK YOU.
URL THAT CODE IS BEING USED ON IS
http://www.infinity-plus.com/modules.php?name=DataFeed
The Code I currently have worked on is as followed.
Code: <?php
/*******************************************************************************/
/* PHP-NUKE: Web Portal System: Catalog DataFeed Addon */
/* ============================================ */
/* Version: 1.00 by Brian Baros */
/* Code by Brian Baros */
/* http://www.Infinity-Plus.com */
/* */
/*******************************************************************************/
///////////////////////START OF MODULE//////////////////////////////////
if (!eregi("modules.php", $_SERVER['PHP_SELF']))
{
die ("You can't access this file directly...");
}
require_once("mainfile.php");
////////////////////////STARTS MODULE ENDS//////////////////////////////
global $sitename, $prefix, $db, $module_name; //SETS 5 GLOBAL VARIBLES
$module_name = basename(dirname(__FILE__)); //DEFINES AND SETS THE $module_name Varible
get_lang($module_name); // GETS Lanuage File For Module
header("Content-Type: text/html");
include("header.php");
{
{
echo "<br>";
OpenTable();
echo "<center><b>"._MYDATAFEED."</center></b><br>"
."<left>"._SELECTASITE."<br><br>"
."<form action=\"modules.php?name=$module_name\" method=\"post\">"
."<input type=\"hidden\" name=\"op\" value=\"userinfo\">"
."<input type=\"hidden\" name=\"username\" value=\"$username\">"
."<input type=\"hidden\" name=\"bypass\" value=\"$bypass\">"
."<input type=\"hidden\" name=\"url\" value=\"0\">"
."<select name=\"hid\" onChange='submit()'>\n"
."<option value=\"0\">"._SELECTASITE2."</option>";
$sql4 = "SELECT hid, sitename, DATAFEEDurl FROM ".$prefix."_DATAFEED ORDER BY sitename";
$headl = $db->sql_query($sql4);
while($row4 = $db->sql_fetchrow($headl))
{
$nhid = intval($row4[hid]);
$hsitename = $row4[sitename];
$durl=$row4[DATAFEEDurl];
if ($hid == $nhid )
{
$sel = "selected";
}
else
{
$sel = "";
}
echo "<option value=\"$nhid\" $sel>$hsitename</option>\n";
}
CloseTable();
}
OpenTable();
$content = "<center>$durl</center>";
echo "<center><b>"._DATAFEEDFROM. " http://www.$hsitename</b></center><br>\n"
. "$content \n";
// echo "$content";
CloseTable();
}
//elseif (($cont == 0) OR ($content == ""))
{
OpenTable();
echo "<center>"._DATAFEEDPROBLEM."</center>\n";
CloseTable();
}
OpenTable();
echo "<b>Warning!!! Not all datafeeds work correctly on this datafeed reader.</b>";
CloseTable();
//}
switch($op)
{
default:
break;
}
include("footer.php");
?>
ARRAY
Posted: Sat Oct 15, 2005 1:55 am
bbaros
Resourceful
Joined: Jul 03, 2005
Posts: 81
Location: Nashville, TN
WELL CURRENTLY I HAVE ALMOST GOT THE PROGRAM TO WORK BUT. I AM HAVING AN ARRAY SHOW UP WHEN SELECTING A SITE..
Instead of having only one Link it shows all.
Can someone pls help me stop this Array.
the code i am currently using is as follows.
Code: <?php
/*******************************************************************************/
/* PHP-NUKE: Web Portal System: Catalog DataFeed Addon */
/* ============================================ */
/* Version: 1.00 by Brian Baros */
/* Code by Brian Baros */
/* http://www.Infinity-Plus.com */
/* */
/*******************************************************************************/
///////////////////////START OF MODULE//////////////////////////////////
if (!eregi("modules.php", $_SERVER['PHP_SELF']))
{
die ("You can't access this file directly...");
}
require_once("mainfile.php");
////////////////////////STARTS MODULE ENDS//////////////////////////////
global $sitename, $prefix, $db, $module_name; //SETS 5 GLOBAL VARIBLES
$module_name = basename(dirname(__FILE__)); //DEFINES AND SETS THE $module_name Varible
get_lang($module_name); // GETS Lanuage File For Module
header("Content-Type: text/html");
include("header.php");
{
if ($content=="")
{
echo "<br>";
OpenTable();
echo "<center><b>"._MYDATAFEED."</center></b><br>"
."<left>"._SELECTASITE."<br><br>"
."<form action=\"modules.php?name=$module_name\" method=\"post\">"
."<input type=\"hidden\" name=\"op\" value=\"userinfo\">"
."<input type=\"hidden\" name=\"username\" value=\"$username\">"
."<input type=\"hidden\" name=\"bypass\" value=\"$bypass\">"
."<input type=\"hidden\" name=\"url\" value=\"0\">"
."<select name=\"hid\" onChange='submit()'>\n"
."<option value=\"0\">"._SELECTASITE2."</option>";
$sql = "SELECT hid, sitename, AdvID FROM ".$prefix."_DATAFEED ORDER BY sitename";
$head = $db->sql_query($sql);
while($row1 = $db->sql_fetchrow($head))
{
$nhid = intval($row1[hid]);
$hsitename = $row1[sitename];
$file = $row1[AdvID];
if ($hid == $nhid )
{
$sel = "selected";
}
else
{
$sel = "";
}
echo "<option value=\"$nhid\" $sel>$hsitename</option>\n";
{
OpenTable();
echo "<center><b><a href=\"http://www.infinity-plus.com/$file\" target=\"new\"><h5>CLICK HERE to view $hsitename product catalog</h5> </a></b></center><br>\n";
// $content = "<center><b>"._DATAFEEDFROM. " http://www.$hsitename</b></center><br>\n";
// include ("$file");
//fopen ("$file");
CloseTable();
}
}
}
else
{
OpenTable();
echo "<center>"._DATAFEEDPROBLEM."</center>\n";
CloseTable();
}
}
{
OpenTable();
echo "<b>Warning!!! Not all datafeeds work correctly on this datafeed reader.</b>";
CloseTable();
}
switch($op)
{
default:
break;
}
include("footer.php");
?>
YOU CAN VIEW THE RESULTS OF THIS PROJECT AT
http://www.infinity-plus.com/modules.php?name=DataFeed
Posted: Sun Oct 16, 2005 1:46 am
Evaders99
Resource Master
Joined: May 25, 2004
Posts: 1785
I'm not sure what you want. If you just want one, then you don't need the while loop code
Code:
while($row1 = $db->sql_fetchrow($head))
If you look at the page?
Posted: Sun Oct 16, 2005 1:21 pm
bbaros
Resourceful
Joined: Jul 03, 2005
Posts: 81
Location: Nashville, TN
If you look at the URL i have setup for this code to be used on you will see what i mean about it selecting all instead of just one.
I want all the names displayed in the Dropdown menu but only the one chosen from the dropdown to be selected.
currently it is displaying ALL items that are in the dropdown and not just one.
the WHILE loop helps acquire all the NAMES for the dropdown menu.
NukeResources Forum Index -> Random Thoughts
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
All times are GMT - 4 Hours
Page 1 of 1
Powered by phpBB © 2001-2005 phpBB Group. Theme created by Vjacheslav Trushkin . There have been 139 unique hit(s) in the past 24 hours.