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
Latest news
AuthorText
Andrei
Junior Member

Posts: 87
Contributes: 165

Gender: _MALE_
Online: No

Country: Romania
Date: 19/12/2008 10:47
Latest news
#post16316
Latest news of a category. Can be done?
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

mem

Posts: 7243
Contributes: 4800

Gender: _MALE_
Online: No

Languages: English, Italiano, Македонски, Српски
Date: 19/12/2008 10:51
Re: Latest news
#post16317
code
$result = $dblink->get_list("SELECT * FROM memht_news WHERE argomento='NN' ORDER BY id DESC LIMIT 1");
foreach ($result as $row) {
   echo "<div>".outCode($row['nome'])."</div>";
}


Where NN is the ID of the topic/argument
Edited: 19/12/2008 10:51
Follow me on twitter if you want to be updated on the MemHT 5 development.
Delete Edit Quote
 
Andrei
Junior Member

Posts: 87
Contributes: 165

Gender: _MALE_
Online: No

Country: Romania
Date: 19/12/2008 11:09
Re: Latest news
#post16318
code
if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_news_top.php")) {
                die("<table style='padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;' align='center'><tr><td><b>Error:</b> This file cannot be opened directly!</td></tr></table>");
        }
       
        global $dblink;
       
        $result = $dblink->get_list("SELECT * FROM memht_news WHERE argomento='13' ORDER BY id DESC LIMIT 5");
foreach ($result as $row) {
   echo "<div><a href='http://www.memht.com/index.php?page=news&op=readNews&id=$nid&title=".mem_urlencode($row['nome'])."' title='".outCode($row['nome'])."' >".outCode($row['nome'])."</a> <br> ".outCode($row['testo_home'])."</div>";
}


Errno: 8
File: /home/x/public_html/x/index.php
Line: 286
Function: include
Note: Undefined variable: nid
Edited: 19/12/2008 11:29
Delete Edit Quote
 
sisnox
Moderator
Developer


Posts: 1664
Contributes: 931

Gender: _MALE_
Online: No

Version: 5
Country: Portugal
Languages: Portuguese and english
Date: 19/12/2008 13:40
Re: Latest news
#post16319
hi

code

if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_news_top.php")) {
                die("<table style='padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;' align='center'><tr><td><b>Error:</b> This file cannot be opened directly!</td></tr></table>");
        }

        global $dblink;

        $result = $dblink->get_list("SELECT * FROM memht_news WHERE argomento='13' ORDER BY id DESC LIMIT 5");
foreach ($result as $row) {
   echo "<div><a href='http://www.memht.com/index.php?page=news&op=readNews&id=".intval($row['id'])."&title=".mem_urlencode($row['nome'])."' title='".outCode($row['nome'])."' >".outCode($row['nome'])."</a> <br> ".outCode($row['testo_home'])."</div>";
}
 
http://www.sisnox.com
Delete Edit Quote
 
Andrei
Junior Member

Posts: 87
Contributes: 165

Gender: _MALE_
Online: No

Country: Romania
Date: 19/12/2008 15:16
Re: Latest news
#post16320
Thanks
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.232

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