Main Menu
Quick Links
Other Options
Information
NukeForums
Top10 Links
Site Visitors
Membership:
Latest: qwertz
Today: 0
Yesterday: 1
Overall: 15102
Visitation:
Guests: 560
Members: 0
Total: 560
You are Anonymous user. You can register for free by clicking here
Sponsor Links
NukeResources :: View topic - Module Query Results Formatting
Module Query Results Formatting
Posted: Mon Apr 10, 2006 9:45 pm
LupinOne
Resource Newbie
Joined: Apr 11, 2005
Posts: 29
Hi all.
Background: I have a module that when called grabs several other modules and returns each modules query into iframe.
The output from the various queries is not picking up the formatting of the particular theme.
I've tried several different code snippets and am presently here:
Code: <?php
if ( !defined('MODULE_FILE') )
{
die("You can't access this file directly...");
}
require_once("mainfile.php");
$instory = '';
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
global $admin, $prefix, $db, $module_name, $articlecomm, $multilingual;
if ($multilingual == 1) {
$queryalang = "AND (s.alanguage='$currentlang' OR s.alanguage='')"; /* stories */
$queryrlang = "AND rlanguage='$currentlang' "; /* reviews */
} else {
$queryalang = "";
$queryrlang = "";
$queryslang = "";
}
switch($op) {
case "comments":
break;
default:
$ThemeSel = get_theme();
$offset=10;
if (!isset($min)) $min=0;
if (!isset($max)) $max=$min+$offset;
$min = intval($min);
$max = intval($max);
$query = stripslashes(htmlentities($query, ENT_QUOTES));
$pagetitle = "- "._SEARCH."";
// include("header.php");
$topic = intval($topic);
if ($topic>0) {
$row = $db->sql_fetchrow($db->sql_query("SELECT topicimage, topictext from ".$prefix."_topics where topicid='$topic'"));
$topicimage = stripslashes($row['topicimage']);
$topictext = stripslashes(check_html($row['topictext'], "nohtml"));
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$topicimage = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$topicimage = $tipath . $topicimage;
}
} else {
$topictext = ""._ALLTOPICS."";
if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
$topicimage = "themes/$ThemeSel/images/topics/AllTopics.gif";
} else {
$topicimage = $tipath . "AllTopics.gif";
}
}
if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
$alltop = "themes/$ThemeSel/images/topics/AllTopics.gif";
} else {
$alltop = $tipath . "AllTopics.gif";
}
OpenTable();
if ($type == "users") {
echo "<center><font class=\"title\"><b>"._SEARCHUSERS."</b></font></center><br>";
} elseif ($type == "reviews") {
echo "<center><font class=\"title\"><b>"._SEARCHREVIEWS."</b></font></center><br>";
} elseif ($type == "comments" AND isset($sid)) {
$res = $db->sql_query("select title from ".$prefix."_stories where sid='$sid'");
list($st_title) = $db->sql_fetchrow($res);
$st_title = stripslashes(check_html($st_title, "nohtml"));
$instory = "AND sid='$sid'";
echo "<center><font class=\"title\"><b>"._SEARCHINSTORY." $st_title</b></font></center><br>";
} else {
echo "<center><font class=\"title\"><b>"._SEARCHIN." $topictext</b></font></center><br>";
}
//Begin Game tool
include("dbaccess.php");
$FORM2 = "
<table width=500 cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=500 height=34 colspan=8 align=center font color=\"#C2C4C3\">
L2 Dementia Top Player Killers - (Top 75)</font>
</td>
</tr>
<tr>
<td style=width:300 height=34 align=center>
<span class=post>Name<hr></span>
</td>
<td style=width:200 align=center>
<span class=post>Player Kills<hr></span>
</td>
</td>
</tr>";
$query = "SELECT characters.char_name,characters.accesslevel,characters.pkkills,accounts.access_level,accounts.login
FROM characters,accounts
WHERE (characters.accesslevel = 0)
AND (characters.account_name = accounts.login)
AND (accounts.access_level <> -100)
ORDER BY pkkills DESC limit 75";
$result = mysql_query($query);
$i = 1;
while($row = mysql_fetch_array($result))
{
$FORM2 .='<tr>
<td style="border-right:1px solid gray" align=left><b>'.$i.'.</b> '.$row['char_name'].'</td>
<td style="border-right:1px solid gray" align=center>'.$row['pkkills'].'</td>
</tr></font>';
$i++;
}
echo $FORM2;
CloseTable2();
// include("footer.php");
//break;
mysql_close();
}
?>
I had to comment out the header.php include because the whole site would be reloaded within the iframe (however the query output gets formatted right).
It picks up the background and the left and top rows, but not the text formatting. I am tired enough that I know I am missing something simple, basic, and most likely stupid.
Little help for the caffine challenged?
Thanks,
Lupin
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.
:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::