Login     Sign up
customize main page
anuacham (@anuacham)
Join date: Dec 19th 2010
Community posts: 24
View Profile
Send Message

hi,
how can we customize such as add the latest articles blog, latest videos, and latest music under the feed stream? Thanks so much.

163 months ago
Eino (@eino)
Join date: Oct 15th 2010
Community posts: 56
View Profile
Send Message

Hello =)

Jcow -> Documentation -> Customize your homepage

or click this link now: [url]http://www.jcow.net/docs/?s=custom_home[/url]

[quote]echo '<div class="block">
<div class="block_title">'.t('Photo albums').'</div>
<div class="block_content">'.get_list('photos','thumb').'</div>
</div>';
echo '<div class="block">
<div class="block_title">'.t('Blogs').'</div>
<div class="block_content">'.get_list('blogs').'</div>
</div>';
echo '<div class="block">
<div class="block_title">'.t('Videos').'</div>
<div class="block_content">'.get_list('videos','thumb').'</div>
</div>';

function get_list($app, $type = '') {
    global $apps;
    if ($type == 'thumb') {
        $num = 4;
    }
    else {
        $num = 10;
    }
    // total
    $res = sql_query("select count(*) as total from `".tb()."stories` where app='$app'");
    $row = sql_fetch_array($res);
    $total = $row['total'];
    $res = sql_query("SELECT s.*,u.username FROM `".tb()."stories` as s LEFT JOIN `".tb()."accounts` as u ON u.id=s.uid where s.app='$app' order by s.id DESC limit $num");
    if ($type == 'thumb') {
        $content .= '<table width="100%"><tr>';
        while ($row = sql_fetch_array($res)) {
            if (!$row['thumbnail']) {
                if ($app == 'music') {
                    $row['thumbnail'] = 'uploads/userfiles/undefined_song.gif';
                }
            else {
                    $row['thumbnail'] = 'uploads/userfiles/undefined.jpg';
                }
            }
            $content .= '<td align="center">'.url($row['app'].'/viewstory/'.$row['id'],htmlspecialchars(utf8_substr($row['title'],20))).'<br />
            <a href="'.url($row['app'].'/viewstory/'.$row['id']).'"><img class="thumb" src="'.uhome().'/'.$row['thumbnail'].'" /></a></td>';
        }
        $content .= '</tr></table>';
    }
    else {
        $content .= '<ul class="simple_list">';
        while ($row = sql_fetch_array($res)) {
            $row['content'] = preg_replace("/\[\w+](.*)\[\/\w+]/isU","\1",$row['content']);
            $row['content'] = strip_tags(utf8_substr($row['content'],90));
            $content .= '<li><strong>'.url($row['app'].'/viewstory/'.$row['id'],htmlspecialchars(utf8_substr($row['title'],60))).'</strong>
            <span class="sub">'.get_date($row['created']).', by '.url('u/'.$row['username'],$row['username']).'</span><br />
            <span class="sub">'.$row['content'].'</span></li>';
        }
        $content .= '</ul>';
    }
    return $content;
}[/quote] 
163 months ago
1
anuacham (@anuacham)
Join date: Dec 19th 2010
Community posts: 24
View Profile
Send Message

Thanks so much eino. Cheer

163 months ago
abdul jalil (@barakuda)
Join date: Oct 8th 2010
Community posts: 6
View Profile
Send Message

what code i must to replace with that?
thanks

163 months ago
1
abdul jalil (@barakuda)
Join date: Oct 8th 2010
Community posts: 6
View Profile
Send Message

sorry double post

163 months ago
rynthariandja (@rynt)
Join date: Oct 25th 2011
Community posts: 3
View Profile
Send Message

where to put the script, please. thanks

153 months ago