Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Modify Utopia News Pro comment display method
Old 03-25-2008, 01:32 AM Modify Utopia News Pro comment display method
Novice Talker

Posts: 7
Trades: 0
The script I'm using for news posting is designed so the comments for each news item are displayed with links like "/news/comments.php?action=list&newsid=1" but I'd like to have the comments displayed below each post, rather than on a separate page. There doesn't seem to be a variable to do this with the templates, so how can I accomplish it? The script is available for download at http://www.utopiasoftware.net/newspr...b.zip&mirror=1

Perhaps there's a better script I should use instead? I don't need a cms script though, just a way to include blog posts on an otherwise static website.
spaz is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-25-2008, 08:16 PM Re: Modify Utopia News Pro comment display method
Novice Talker

Posts: 7
Trades: 0
Ok well I hacked parted of the news.php script to include sections from comments.php relevant to listing comments. I'm using the $comments_list_commentbit variable in the news_newsbit_commentslink template, but I'm only getting one comment out of 5 in the database showing up, and it's showing on the wrong newsid. Any ideas?

PHP Code:
if ($action == '')
{
    
define('ISPRINTABLEPAGE'false);
    
define('WILLTRUNCATE'true);
    
define('ISRSS'false);
    
$templatesused 'news_newsbit,news_newsbit_commentslink,news_avatarbit,news_newsbit_readmorelink,comments_list_commentbit';
    
unp_cacheTemplates($templatesused);
    
$getnews $DB->query("SELECT * FROM `unp_news` ORDER BY `date` DESC LIMIT $newslimit");
    while (
$news $DB->fetch_array($getnews))
    {
        
$catid $news['catid'];
        
$category $categorycache["$catid"];
        
$newsid $news['newsid'];
        
$subject $news['subject'];
        
$newstext $news['news'];
        
$poster $news['poster'];
        
$posterid $news['posterid'];
        
$date $news['date'];
        
$postdate unp_date($dateformat$date);
        
$posttime unp_date($timeformat$date);
        
$avatar unp_checkAvatar($posterid);
        if (!
$avatar)
        {
            
$useravatar '';
        }
        else
        {
            eval(
'$useravatar = "'.unp_printTemplate('news_avatarbit').'";');
        }
        if (
$commentsallowance == '1')
        {
            
$comments $news['comments'];
            eval(
'$commentsinfo = "'.unp_printTemplate('news_newsbit_commentslink').'";');
        }
        else
        {
            
$commentsinfo ' ';
        }
        
$comments $news['comments'];
        
//$newstext = $n->unp_doNewsTrim($newstext); // Move to unp_doNewsFormat
        
$newstext $n->unp_doNewsFormat($newstext);
        
$subject $n->unp_doSubjectFormat($subject);
        
// NewsBit
        
eval('$news_newsbit = "'.unp_printTemplate('news_newsbit').'";');
        
unp_echoTemplate($news_newsbit);
        
// NewsBit
        
echo "\n\n";
        
$getcomments $DB->query("SELECT * FROM `unp_comments` WHERE newsid='$newsid'");
            if (
$DB->num_rows($getcomments) > 0)
            {
                while (
$comments $DB->fetch_array($getcomments))
                {
                    
// grab and fix up comments
                    
$c_id $comments['id'];
                    
$c_title htmlspecialchars(stripslashes($comments['title']));
                    
$c_name htmlspecialchars(stripslashes($comments['name']));
                    
$c_email htmlspecialchars(stripslashes($comments['email']));
                    
$c_date unp_date($dateformat$comments['date']);
                    
$c_time unp_date($timeformat$comments['date']);
                    
$c_text nl2br(htmlspecialchars(stripslashes($comments['comments'])));
                    
$c_ipaddress $comments['ipaddress'];
                    
$c_proxy $comments['proxy'];
                    
$c_text $n->unp_doSmilies($c_text);        
                    eval(
'$comments_list_commentbit = "'.unp_printTemplate('comments_list_commentbit').'";');
                }
            }
            else
            {
                
$comments_list_commentbit '';
            }
    }
    unset(
$news);

spaz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Modify Utopia News Pro comment display method
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21809 seconds with 12 queries