 |
|
| View previous topic :: View next topic |
| Author |
Message |
digital-kris Guest
|
Posted: Thu Mar 06, 2003 10:35 am Post subject: |
|
|
if a registered user submits an article (news), that has to be verified and put online by the site-admin, the text on the homepage says something
written by admin at 24. Feb. 2993 @ 12.34 h
written by registered user ...
and then the text follows in italic letters...
i want for the normal users, when they submit news, that there is only one line for the author, like when an admin post news ... and in this line the name of the user is there instead of the admin-name ... and the text must be in normal letters
little complicated, hope you can help |
|
| Back to top |
|
 |
|
|
 |
chris President


Joined: 06 Nov 2002 Posts: 1047 Location: Outer Space
|
Posted: Thu Mar 06, 2003 8:57 pm Post subject: |
|
|
This is done in the function themeindex() in the file theme.php of your theme, e.g. themes/NukeNews/theme.php. Change the following:
| Code: |
if ("$aid" == "$informant") {
$content = "$thetext$notesn";
} else {
if($informant != "") {
$content = "<a href="modules.php?name=Your_Account&op=userinfo&uname=$informant">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>"$thetext"</i>$notesn";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
|
to
| Code: |
$content = "$thetext$notesn";
$posted = ""._POSTEDBY." ";
if("$informant" == "") {
$posted .= "$anonymous ";
} else {
$posted .= get_author($informant);
}
|
Regards
Chris
|
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Fri Mar 07, 2003 8:21 am Post subject: |
|
|
doesn't seem to work. can u try to change my code, looks like this
[code]
function themeindex ($aid, $informant, $date, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath;
echo "<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td bgcolor="#000000">n"
."<table border="0" cellpadding="5" cellspacing="1" width="100%"><tr><td bgcolor="#FFFFFF">n"
."<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td bgcolor="#FFFFFF">n"
."<img src="themes/zockt_beta/images/dot.gif" border="0"></td><td width="100%" bgcolor="#FFFFFF"><font class="option"><b> $title</b></font></td></tr>n"
."<tr><td colspan="2" bgcolor="#FFFFFF">n"
."<table border="0" width="98%" align="center"><tr><td>n"
."<font class="tiny">"._POSTEDBY." ";
formatAidHeader($aid);
echo " ".am." $date ($counter "._READS.")<br><br></font>n"
."<a href="modules.php?name=News&new_topic=$topic"><img src="$tipath$topicimage" alt="$topictext" border="0" align="right"></a>";
FormatStory($thetext, $notes, $aid, $informant);
echo "</td></tr></table>n"
."</td></tr></table><br>n"
."</td></tr><tr><td bgcolor="#FFFFFF" align="left">n"
."<font class="content">$morelink</font></left>n"
."<img src="themes/zockt_beta/images/pixel.gif" border="0" height="3">n"
."</td></tr></table>n"
."</td></tr></table><br>n";
}
[code] |
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Tue Mar 11, 2003 2:30 am Post subject: |
|
|
hi there,
got the italics, was easy indeed ... thx ...
but the other things is still driving me crazy... CODE IS ABOVE ... maybe you can have a look.
what i want fpr the actual article on homepage is that first comes the headline (that works), second line is normally the author (admin) who submitted the news and then the impossible ...
if news is submitted by user, the second line should show the name of the user instead of the admin who has to set the news free ...
plese help |
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Tue Mar 11, 2003 9:17 am Post subject: |
|
|
I have done the same thing on my theshanty.com site.
Here's what to do, in that function themeindex, replace formatAidHeader($aid); with this:
| Code: |
if ($informant == "") {
$informant = "Anonymous";
}else {
$holder = sql_query("SELECT url, femail FROM ".$user_prefix."_users where uname='$informant'", $dbi);
list($url, $femail) = sql_fetch_row($holder, $dbi);
if ($url != "") {
$informant = "<a href="$url">$aid</a>";
} elseif ($femail != "") {
$informant = "<a href="mailto:$femail">$informant</a>";
} else {
$informant = "<a href="modules.php?name=Your_Account&op=userinfo&uname=$informant">$aid</a>";
}
}
echo "$informant"; |
Now, we need to edit your function FormatStory.
Paste in your code for it - basically, you just want something like this:
| Code: | function FormatStory($thetext, $notes, $aid, $informant) {
if ($notes != "") {
$notes = "<b>"._NOTE."</b> <i>$notes</i>n";
} else {
$notes = "";
}
echo "<font size="2">$thetext<br>$notes</font>n";
} |
[ This Message was edited by: Humpa on 2003-03-11 11:21 ] |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Tue Mar 11, 2003 9:45 am Post subject: |
|
|
theme still works apart from the problem that this error appears and the author line didn't change ... oh boy, hope i don't get on your nerves ...
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /is/htdocs/42994/www.mypage.com/includes/sql_layer.php on line 301
|
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Tue Mar 11, 2003 9:54 am Post subject: |
|
|
I dont see an error in the code.
Try this to see what is causing the error:
To get a more descriptive error message, you can edit the "case" lines in the sql_layer.php.
For example, this is the "case" that starts at line 300 in the nuke 6.0 sql_layer.php (for the line 301 error message)
- or line 285 in nuke 5.6 (for the line 286 error message):
| Code: | case "MySQL":
$row = mysql_fetch_row($res);
return $row;
break;; |
Edit it like this:
| Code: | case "MySQL":
if ($row = mysql_fetch_row($res)) {
return $row;
} else {
print (mysql_error());
}
break;; |
[ This Message was edited by: Humpa on 2003-03-11 11:55 ] |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Thu Mar 13, 2003 1:48 am Post subject: |
|
|
that print-trick works ... error is:
| Code: | | Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /is/htdocs/42994/www.zockt.de/includes/sql_layer.php on line 301 |
code ist changed like this ...
| Code: |
function FormatStory($thetext, $notes, $aid, $informant) {
if ($notes != "") {
$notes = "<b>"._NOTE."</b> <i>$notes</i>n";
} else {
$notes = "";
}
echo "<font size="2">$thetext<br>$notes</font>n";
} |
and this thing ...
| Code: |
function themeindex ($aid, $informant, $date, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath;
echo "<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td bgcolor="#000000">n"
."<table border="0" cellpadding="5" cellspacing="1" width="100%"><tr><td bgcolor="#FFFFFF">n"
."<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td bgcolor="#FFFFFF">n"
."<img src="themes/zockt_beta/images/dot.gif" border="0"></td><td width="100%" bgcolor="#FFFFFF"><font class="option"><b> $title</b></font></td></tr>n"
."<tr><td colspan="2" bgcolor="#FFFFFF">n"
."<table border="0" width="98%" align="center"><tr><td>n"
."<font class="tiny">"._POSTEDBY." ";
if ($informant == "") {
$informant = "Anonymous";
}else {
$holder = sql_query("SELECT url, femail FROM ".$user_prefix."_users where uname='$informant'", $dbi);
list($url, $femail) = sql_fetch_row($holder, $dbi);
if ($url != "") {
$informant = "<a href="$url">$aid</a>";
} elseif ($femail != "") {
$informant = "<a href="mailto:$femail">$informant</a>";
} else {
$informant = "<a href="modules.php?name=Your_Account&op=userinfo&uname=$informant">$aid</a>";
}
}
echo "$informant";
echo " ".am." $date ($counter "._READS.")<br><br></font>n"
."<a href="modules.php?name=News&new_topic=$topic"><img src="$tipath$topicimage" alt="$topictext" border="0" align="right"></a>";
FormatStory($thetext, $notes, $aid, $informant);
echo "</td></tr></table>n"
."</td></tr></table><br>n"
."</td></tr><tr><td bgcolor="#FFFFFF" align="left">n"
."<font class="content">$morelink</font></left>n"
."<img src="themes/zockt_beta/images/pixel.gif" border="0" height="3">n"
."</td></tr></table>n"
."</td></tr></table><br>n";
} |
|
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Thu Mar 13, 2003 6:27 am Post subject: |
|
|
| I dont see the "more descriptive error message" .. wasnt there another line to the error message after applying that edit to the sql_layer.php? |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Thu Mar 13, 2003 6:59 am Post subject: |
|
|
| no ... but there was more than beforde the "more desc", but just what's in the thread above ... |
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Thu Mar 13, 2003 9:43 am Post subject: |
|
|
Is the error message different?
When edit the sql_layer.php as I have described, you usually will get an extra line on the error message.
Are you getting this extra line?
Can I see? |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Thu Mar 13, 2003 10:18 am Post subject: |
|
|
i guess its that line ...
mysql_fetch_row(): supplied argument is not a valid argument |
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Thu Mar 13, 2003 10:29 am Post subject: |
|
|
When you edit the sql_layer.php as I have described, you usually will get an extra line on the error message.
1. Are you getting this extra line?
2. Can I see?
|
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Thu Mar 13, 2003 10:53 am Post subject: |
|
|
| sorry, got you wrong ... no, there is no extra textline been printed if i insert the above line in the sql-thingie ... |
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Thu Mar 13, 2003 12:51 pm Post subject: |
|
|
(I thought, perhaps, that if I numbered my questions, you would answer them all. )
[ This Message was edited by: Humpa on 2003-03-13 14:52 ] |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Fri Mar 14, 2003 9:35 am Post subject: |
|
|
can you please try to modify my code that i already posted above. that would be absolutely awesome!!! thanks kris  |
|
| Back to top |
|
 |
chatserv President


Joined: 19 Aug 2001 Posts: 3258
|
Posted: Fri Mar 14, 2003 10:10 am Post subject: |
|
|
| If the site in question is http://www.zockt.de/ i notice it is missing Nuke`s copyright lines, not good... |
|
| Back to top |
|
 |
digital-kris Guest
|
Posted: Fri Mar 14, 2003 10:48 am Post subject: |
|
|
well, it is missing on the mainpage, but we gave credit on our beloved about-us-page ... zockt.de | about us
but yes, the site we are talking about ist zockt.de ...
any ideas?
|
|
| Back to top |
|
 |
Humpa President

Joined: 23 Apr 2002 Posts: 3429
|
Posted: Fri Mar 14, 2003 10:56 am Post subject: |
|
|
FB wants everyone to at least put in some sort of copywrite notice/link down at the bottom, which you kind of have - maybe mention phpnuke, or put in the phpnuke gif down there.
Also, you should add $user_prefix and $dbi to the global line in the function themeindex - that is the only thing wrong with your code. |
|
| Back to top |
|
 |
|
|
 |
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|