Login     Sign up
Need a Blog type thing
joseph Boysha (@jcboysha)
Join date: Dec 29th 2010
Community posts: 5
View Profile
Send Message

Evenin' Jcow fans,

I run a website called www.geekipality.com (you're very welcome to check it out) and I had a question.

Does anyone have any idea how one would incorporate a blog into Jcow?

What I want is something like Joomla, or Drupal, or otherwise, to make a blog for myself and the other three admins of my site.

Any help would be nice.

--JC

170 months ago
joseph Boysha (@jcboysha)
Join date: Dec 29th 2010
Community posts: 5
View Profile
Send Message

To be more specific. I want it to be on the front page of the website, and I only want 4 people to be able to do it. Not everyone like the blog module on Jcow already.

170 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

yeah may be possible with user role permisiions and
[code]
do_auth(id#);[/code]

eg: do_auth(1); or do_auth(1,13) for admin(id1) and say silver members(id13)...somewhere in blog.php so that only those with member id 1-13 can post to blogs

(you need to look in phpmyadmin to get your role ids..check database table jcow_roles for the id number )

and this on your frontpage

[code]

echo '<div class="block">
<div class="block_title">'.t('Blogs').'</div>
<div class="block_content">'.get_list('blogs').'</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;
}

[/code]

just to busy to tackle it myself

170 months ago