MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
Sources comments
AuthorText
Wloczykij
Junior Member

Posts: 19
Contributes: 20

Gender: _MALE_
Online: No

Languages: Polish
Version: 4.0.1
Country: POLAND
Date: 16/05/2009 13:33
Sources comments
#post19992
New version.
/********************************************
http://eioban.com/download.html
********************************************/
Added: Date
Added: Move to the comments at the source.

Dodano: data
Dodano: Przeniesienie do komentarzy pod źródłem.
********************************************/

I have comments on the page, right side.
It is worth nothing.

I decided to make a comment where he directed was placed.

With the help came to me admin / pages / comments

There is:
ID, email, date, page, lvl, I care about "page". This is a link to the article where a comment was placed.

This is my script comments on the page.

code
<?php echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; ?>
<?php echo '<?xml-stylesheet type="text/css" href="style.css"?'.">\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">   
<head>
<?php

 if (!defined("_RECENT_COMMENTS_")) { define("_RECENT_COMMENTS_","Recent comments"); }
global $dblink,$siteConfig;

?>

<div style="color: red; text-align: center;"><?php echo "W Budowie<br />Underconstruction<br /><br />"; ?>
</div>

<?php
                                        $result = $dblink->get_list("SELECT name,text FROM memht_comments WHERE moderate=0 ORDER BY id DESC LIMIT 5");
                                        foreach ($result as $row) {
                                                $name = outCode($row['name']);
                                                $text = outCode($row['text']);

                                               
                                                echo "<table><tr><td><div style='padding:2px 2px; background: #dddbd5;'><img src='templates/".$siteConfig['template']."/images/page_white.gif' border='0' alt='Bullet'> <span style='vertical-align: top;'><b>$name: </b></td><tr></tr><tr><td>".trimString($text,80,1)."<br /></a></span></div></td></tr></table>\n";
}
                               
                                       
?>
</head>
</html>


The script which I would like to join the present.

43 - 203 line admin/pages/comments

I'm interested in only the transfer to the article where he was given a comment.

So the variables:
code

$whr = intval($row['whr']);
$wid = intval($row['wid']);



Modifications to the script please. I know that the administration does not modify. So please members.


Regards
eioban.com
Edited: 26/05/2009 12:11
Reason: Update
<?php
?>
Delete Edit Quote
 
Wloczykij
Junior Member

Posts: 19
Contributes: 20

Gender: _MALE_
Online: No

Languages: Polish
Version: 4.0.1
Country: POLAND
Date: 19/05/2009 00:25
Re: Sources comments
#post20069
Found a similar thread. I did as was written there. But does not work properly.

code
<?php
$result = $dblink->get_list("SELECT id,name,text,wid FROM memht_comments WHERE moderate=0 ORDER BY id DESC LIMIT 7");
foreach ($result as $row) {

$name = outCode($row['name']);
$text = outCode($row['text']);
$wid = intval($row['wid']);

                                               
echo "<table><tr><td><div style='padding:2px 2px; background: #dddbd5;'><img src='templates/".$siteConfig['template']."/images/page_white.gif' border='0' alt='Bullet'></a> <span style='vertical-align: top;'><b><a href='http://www.memht.com/index.php?page=articles&op=readArticle&id=$wid'>$name $wid</a> </b></td><tr></tr><tr><td>".trimString($text,80,1)."<br /></span></div></td></tr></table>\n";
}
?>


$ Wid added for better orientation. Some work correctly and some bad. First 3 / 42 bad. 53/30 works. After an increase in the amount of comments that appear, again, some work and some not.

What's wrong?
eioban.com

Edit2.

I know where the problem.

ID news, articles, mix one another. How to separate? Some news have similar ID as articles.

Some comments are
code
<a href='index.php?page=articles&op=readArticle&id=$wid'>
news and not from the Articles.
Edited: 19/05/2009 01:08
<?php
?>
Delete Edit Quote
 
Wloczykij
Junior Member

Posts: 19
Contributes: 20

Gender: _MALE_
Online: No

Languages: Polish
Version: 4.0.1
Country: POLAND
Date: 19/05/2009 12:28
Re: Sources comments
#post20075
If someone needs a script to comments, I finished it ...

code
<?php

if (!defined("_RECENT_COMMENTS_")) { define("_RECENT_COMMENTS_","Recent comments"); }
global $dblink,$siteConfig;

$result = $dblink->get_list("SELECT whr,name,text,wid FROM memht_comments WHERE moderate=0 ORDER BY id DESC LIMIT 7");
foreach ($result as $row) {

$name = outCode($row['name']);
$text = outCode($row['text']);
$wid = intval($row['wid']);
$whr = intval($row['whr']);
               
switch ($whr) {

case 1:
$nome = "articles";
$irow = $dblink->get_row("SELECT nome FROM memht_articoli WHERE id=$wid");
$whritem = outCode($irow['nome']);
whrlink = "index.php?page=articles&op=readArticle&id=$wid&title=".mem_urlencode($whritem);
break;

case 2:
$nome = "guide";
$irow = $dblink->get_row("SELECT nome FROM memht_guide WHERE id=$wid");
whritem = outCode($irow['nome']);
whrlink = "index.php?page=guide&op=readGuide&id=$wid&title=".mem_urlencode($whritem);
break;

case 3:
$nome = "news";
$irow = $dblink->get_row("SELECT nome FROM memht_news WHERE id=$wid");
$whritem = outCode($irow['nome']);
$whrlink = "index.php?page=news&op=readNews&id=$wid&title=".mem_urlencode($whritem);
break;
               
case 4:
$nome = "download";
$irow = $dblink->get_row("SELECT nome FROM memht_download WHERE id=$wid");
$whritem = outCode($irow['nome']);
$whrlink = "index.php?page=download&op=getFile&id=$wid&title=".mem_urlencode($whritem);
break;

case 5:
$nome = "blog";
$row = $dblink->get_row("SELECT title FROM memht_blog_posts WHERE id=$wid");
$whritem  = outCode($row['title']);
$whrlink = "index.php?page=blog&id=$wid&title=".mem_urlencode($whritem);
break;

case 6:
$nome = "surveys";
$irow = $dblink->get_row("SELECT question FROM memht_survey WHERE id=$wid");
$whritem = trimString(outCode($irow['question']),40,1);
$whrlink = "index.php?page=surveys&op=result&id=$wid#comments";
break;
}

echo "<table><tr><td><div style='padding:2px 2px; background: #dddbd5;'><img src='templates/".$siteConfig['template']."/images/page_white.gif' border='0' alt='Bullet'></a> <span style='vertical-align: top;'><b><a href='$whrlink'>$name</a> </b></td><tr></tr><tr><td>".trimString($text,80,1)."<br /></span></div></td></tr></table>\n";
               
}
?>
<?php
?>
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.231

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo