Nuke Toolbar

          
Quick Links 
 [Home Page ][ Category Listings ][ Forum Listings][ Forum FAQs]
[ HomeDNS - Domains ]  [ Nuke Resources ]  [ Nuke Skins and Themes ]  [ Nuke Sites Link Directory ]
[ LearningLinux.com ]  [ Nuke Fixes ]
[ NukeZone Hosting ]  [ Domain Name Database ]
Nuke Forums Forum Index

Nuke Sites Link Directory


submit news problem

 
Post new topic   Reply to topic    Nuke Forums Forum Index -> PHP-Nuke 6.x Discussions
View previous topic :: View next topic  
Author Message
digital-kris
Guest






PostPosted: Thu Mar 06, 2003 10:35 am    Post subject: Reply with quote

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
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Thu Mar 06, 2003 8:57 pm    Post subject: Reply with quote

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&amp;op=userinfo&amp;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
View user's profile Send private message Send e-mail Visit poster's website
digital-kris
Guest






PostPosted: Fri Mar 07, 2003 8:21 am    Post subject: Reply with quote

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>&nbsp;$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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Fri Mar 07, 2003 9:05 am    Post subject: Reply with quote

The italics will be in the function formatStory in that theme - all themes are different ...
Here is an italics in News thread:
http://www.nukeforums.com/forums/viewtopic.php?topic=6778&forum=4

And here is a Posted By thread:
http://www.nukeforums.com/forums/viewtopic.php?topic=12588&forum=42

[ This Message was edited by: Humpa on 2003-03-07 11:06 ]
Back to top
View user's profile Send private message
digital-kris
Guest






PostPosted: Tue Mar 11, 2003 2:30 am    Post subject: Reply with quote

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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Tue Mar 11, 2003 9:17 am    Post subject: Reply with quote

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
View user's profile Send private message
digital-kris
Guest






PostPosted: Tue Mar 11, 2003 9:45 am    Post subject: Reply with quote

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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Tue Mar 11, 2003 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
digital-kris
Guest






PostPosted: Thu Mar 13, 2003 1:48 am    Post subject: Reply with quote

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>&nbsp;$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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Thu Mar 13, 2003 6:27 am    Post subject: Reply with quote

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
View user's profile Send private message
digital-kris
Guest






PostPosted: Thu Mar 13, 2003 6:59 am    Post subject: Reply with quote

no ... but there was more than beforde the "more desc", but just what's in the thread above ...
Back to top
Humpa
President
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Thu Mar 13, 2003 9:43 am    Post subject: Reply with quote

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
View user's profile Send private message
digital-kris
Guest






PostPosted: Thu Mar 13, 2003 10:18 am    Post subject: Reply with quote

i guess its that line ...

mysql_fetch_row(): supplied argument is not a valid argument
Back to top
Humpa
President
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Thu Mar 13, 2003 10:29 am    Post subject: Reply with quote

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
View user's profile Send private message
digital-kris
Guest






PostPosted: Thu Mar 13, 2003 10:53 am    Post subject: Reply with quote

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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Thu Mar 13, 2003 12:51 pm    Post subject: Reply with quote

Quote:
2. Can I see?

(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
View user's profile Send private message
digital-kris
Guest






PostPosted: Fri Mar 14, 2003 9:35 am    Post subject: Reply with quote

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
President


Joined: 19 Aug 2001
Posts: 3258


PostPosted: Fri Mar 14, 2003 10:10 am    Post subject: Reply with quote

If the site in question is http://www.zockt.de/ i notice it is missing Nuke`s copyright lines, not good...
Back to top
View user's profile Send private message Visit poster's website
digital-kris
Guest






PostPosted: Fri Mar 14, 2003 10:48 am    Post subject: Reply with quote

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
President


Joined: 23 Apr 2002
Posts: 3429


PostPosted: Fri Mar 14, 2003 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Nuke Forums Forum Index -> PHP-Nuke 6.x Discussions All times are GMT - 8 Hours
Page 1 of 1

 
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


Powered by phpBB © 2001, 2005 phpBB Group




Forum Options
Main Menu
index.php?sid=d90ce86af834a00d0c31dbe447feee83Forums Index
    - Collaped View
    + Expanded View
FAQFAQ
SearchSearch
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Visitor Options
 
Subscribe
Unsubscribe


Keep informed of updates, bug fixes, software releases, news and more!
Installation or Upgrade Services for phpNuke or PostNuke? Require site maintenance, addons, modules or custom themes? Send private message or e-mail for rates and availablity.

Quick Links
  Domain Names
  Firewall Forums
  Joke Crazy
  Learning Linux
  Find your IP Fast!
  Purchase WinRAR

Trusted Nuke Sites
  NukeZone Hosting
  CMS Focus
  NukeFixes.com
  NukeResources.com
  NukeSkins.com
  NukeSites.com
  PHPNuke.org

Sponsor Links


NukeZone Hosting