Welcome to Geeklog Sunday, October 22 2017 @ 02:15 am EDT


Status: offline

ivy

Forum User
Full Member
Registered: 25/11/2004
Posts: 290
Location:Tokyo Japan
Hi all, Japanese member, nakanishi created phpblock_lastarticles. You can download it from here. phpblock_lastarticles() shows Last articles. ex)http://www.geeklog.jp/ ex)http://www.geeklog.jp/staticpages/index.php/news Please use it in Staticpages.PHP
Geeklog Japan https://www.geeklog.jp

Status: offline

jmucchiello

Forum User
Full Member
Registered: 29/08/2005
Posts: 985
This isn't really a phpblock as you cannot call it from within the block control nor from COM_formatBlock. This is just code you can call within GL. I guess there really isn't a better place to put in on this website. But you should not name the function phpblock_ since it does not follow the interface for normal GL blocks.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/2004
Posts: 290
Location:Tokyo Japan
Thanks for reply, jmucchiello.

We can use it in PHP block correctry.
If you use it in Staticpage.PHP, you can use option of the function, too.

Geeklog Japan https://www.geeklog.jp

Wendel

Anonymous
embarrassed
:banghead: Who's install the phpblock_lastarticles, on my Geeklog system?
Help - me

Thanks

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/2003
Posts: 969
Location:The Netherlands, where else?
There's another block that does nearly the same, search for 'story by topic block' or something like that.
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
Posts: 1569
Location:la rochelle, France

:banghead: Who's install the phpblock_lastarticles, on my Geeklog system?
Help - me

Thanks



This is an old post but for the future...

Do not forget

PHP Formatted Code
$exclude=array('');  
 echo phpblock_lastarticles(10,50,$exclude);
 


like this one:

PHP Formatted Code


function phpblock_lastarticles($numrows=10, $Length=50, $exclude)
{
    global $_CONF, $_TABLES, $LANG04;
    //$Length=50;
    //$numrows=10;
    //Get appropriate stories from DB
       
        $exc = '';
        if (count($exclude)>0) {
           foreach ($exclude as $topic) {
             $exc .= " AND s.tid!='" . $topic ."'";
           }
        }

    $sql = "SELECT STRAIGHT_JOIN s.sid, s.tid,s.title, s.date, s.group_id,s.owner_id,s.perm_owner,s.perm_group,s.perm_members,s.perm_anon,t.topic,s.introtext from {$_TABLES['stories']} as s, {$_TABLES['topics']} as t WHERE s.title<>'' AND (s.tid = t.tid) AND (s.draft_flag = 0)". $exc . " ORDER BY s.date DESC LIMIT " . $numrows;
    //    echo $sql;
    $result = DB_query($sql);
    $nrows = DB_numRows($result);    

    //Display title of stories.
    $i=0;
    $retval='';
    do{
                $A = DB_fetchArray($result);
                //$descr = filter_ALL_HTML($A['introtext']);
                //$descr = mb_strimwidth ($descr, 0, 256, "...");
                $datestr = substr($A['date'],0,10);
                $TACCESS=SEC_hasTopicAccess($A['tid']);
                $ACCESS=SEC_hasAccess($A['owner_id'], $A['group_id'] ,$A['perm_owner'] ,$A['perm_group'] ,$A['perm_members'] ,$A['perm_anon']);

                $title =  mb_strimwidth ($A['title'], 0, $Length);
                if ($ACCESS>0 AND $TACCESS>0)
                {
                        // $title=COM_truncate($A['title'],$Length,'...');
                        $retval .= '<h1><br/><a class="non-ul" href="' . $_CONF['site_url'] . '/article.php?story=' . $A['sid']. '">' . $title . '<span>' . $descr . '</span></a></h1>' ;
                } else {
                        // $title=COM_truncate($A['title'],$Length,'...');
                        $retval .= '<h1><br/><span class="non-u">' . $title . "</span></h1>";
                }
                $retval .= ' on '. $datestr .'  Topic '. $A['topic'] .'<br/>';
                $i++;
    }while ($nrows>$i);

    return $retval;
}


 $exclude=array('');  
 echo phpblock_lastarticles(10,50,$exclude);

I'm available to customise your themes or plugins for your Geeklog CMS

Zmxn

Anonymous
Hi. Please help me how use this phpblock in geeklog 1.5.1?
on 1.4.1 it working great. but after upgrading on one of my geeklog sites it's stop working. Newbie needs your help :banghead: Oops!

Zmxn

Anonymous
someone help me with instalation this block on Geeklog 1.5.1 please Cry

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/2003
Posts: 969
Location:The Netherlands, where else?
This one works: http://www.geeklog.net/forum/viewtopic.php?showtopic=36939
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net

All times are EDT. The time is now 02:15 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content