can any one help me with this little piece of code?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   can any one help me with this little piece of code?
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
Hi guys need your help on this code to work, any assistance would be greatly appreciated. thanks in advance.


OpenTable();
        $result9 = "SELECT uname FROM ".$prefix."_nsngr_users WHERE qid='3'";
        $uname2 = $db->sql_query($result9);
        $result = $db->sql_query("SELECT qid, uid, uname, subject, timestamp, alanguage FROM ".$prefix."_queue WHERE uname='$uname2' THEN order by timestamp DESC");
        if($db->sql_numrows($result) == 0) {
            echo "<table width=\"100%\"><tr><td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NOSUBMISSIONSPLATINUM."</b></td></tr></table>\n";
        } else {
            echo "<center><font class=\"content\"><b>"._NEWSUBMISSIONSPLATINUM."</b></font><form action=\"".$admin_file.".php\" method=\"post\"><table width=\"100%\" border=\"1\" bgcolor=\"$bgcolor2\"><tr><td><b>&nbsp;"._TITLE."&nbsp;</b></td>";
            if ($multilingual == 1) {
                  echo "<td><b><center>&nbsp;"._LANGUAGE."&nbsp;</center></b></td>";
            }
                echo "<td><b><center>&nbsp;"._AUTHOR."&nbsp;</center></b></td><td><b><center>&nbsp;"._DATE."&nbsp;</center></b></td><td><b><center>&nbsp;"._FUNCTIONS."&nbsp;</center></b></td></tr>\n";
            while (list($qid, $uid, $uname, $subject, $timestamp, $alanguage) = $db->sql_fetchrow($result)) {
                $qid = intval($qid);
                $uid = intval($uid);
                /*
                $hour = "AM";
                ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $timestamp, $datetime);
                if ($datetime[4] > 12) { $datetime[4] = $datetime[4]-12; $hour = "PM"; }
                $datetime = date(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
                */
                echo "<tr>\n";
                echo "<td width=\"100%\"><font class=\"content\">\n";
                if ($subject == "") {
                    echo "&nbsp;<a href=\"".$admin_file.".php?op=DisplayStory&amp;qid=$qid\">"._NOSUBJECT."</a></font>\n";
                } else {
                    echo "&nbsp;<a href=\"".$admin_file.".php?op=DisplayStory&amp;qid=$qid\">$subject</a></font>\n";
                }
                if ($multilingual == 1) {
                        if ($alanguage == "") {
                                    $alanguage = _ALL;
                        }
                        echo "</td><td align=\"center\"><font size=\"2\">&nbsp;$alanguage&nbsp;</font>\n";
                }
                if ($uname != $anonymous) {
                        echo "</td><td align=\"center\" nowrap><font size=\"2\">&nbsp;<a href='userinfo-.html$uname'>$uname</a>&nbsp;</font>\n";
                } else {
                        echo "</td><td align=\"center\" nowrap><font size=\"2\">&nbsp;$uname&nbsp;</font>\n";
                }
                $timestamp = explode(" ", $timestamp);
                echo "</td><td align=\"right\" nowrap><font class=\"content\">&nbsp;$timestamp[0]&nbsp;</font></td><td align=\"center\"><font class=\"content\">&nbsp;<a href=\"".$admin_file.".php?op=DeleteStory&amp;qid=$qid\">"._DELETE."</a>&nbsp;</td></tr>\n";
                $dummy++;
            }
            if ($dummy < 1) {
                echo "<tr><td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NOSUBMISSIONS."</b></form></td></tr></table>\n";
            } else {
                echo "</table></form>\n";
            }
        }
    if ($radminsuper==1) {
        echo "<br><center>"
            ."[ <a href=\"".$admin_file.".php?op=subdelete\">"._DELETE."</a> ]"
            ."</center><br>";
    }
    CloseTable();




_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   re: can any one help me with this little piece of code?
Gareth
CZ Addict
 Codezwiz Site Donator
Gareth has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student, Webmaster
Gender: Male
Fav. Sports Team: Liverpool FC
Status: Offline
Joined: May 29, 2004
0.08 posts per day
Posts: 587
Points: 38,220
   
Well, what is it supposed to do, and what isn't working about it? Include more detail for faster help icon_mrgreen.gif

Gareth



Back to top Reply with quote
#3   re: can any one help me with this little piece of code?
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
Hi gareth,

the code is an extension of the admin section of submitted news. I want to separate the news submitted by the website staff from the reqular members. i used the nsn groups to separate the staff from regular members my problem is the table _queue doesnt have the "gid" row for which to identify if a member is one of my staff. So i have to pull the group id info from the table _nsngr_users and integerate it in the code and im having problems on how to properly call the mysql database and be able to just show the news submitted by my staff.

I hope i was able to explain it properly. icon_smile.gif




_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Its realy hard to tell with out seeing whats going on. I can tell you that when you pull the username it should be in a loop or you will only get one row of data.


$uname2 = $db->sql_query($result9);


Should be:


while($uname2 = $db->sql_fetchrow($db->sql_query($result9))) {




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: can any one help me with this little piece of code?
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
Hi Telli, nice to hear from you.

I have been trying to implement the code you advised me but i can seem to place the closing } in the right place all i get always is a blank page.

here is the original code of the news admin index i hope you could pinpoint where to place the additional code. Thanks thanks thanks telli.

I'll just attach the file......



Attached Files
index.zip (11.35 KB, Downloaded: 5231 Time(s))



_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum