Page 1 of 2

FAO Mark - Your Blog Module

Posted: Sat Jun 24, 2006 9:01 am
by NickR
Hi

I am interested in using your blog module, I have read it is based on the news module and relies on comments.

What changes did you make to the news module ?

Thanks Nick

Re: FAO Mark - Your Blog Module

Posted: Sat Jun 24, 2006 1:38 pm
by Dr.CSS
reworded it and a couple other things, see it in action...
http://www.multiintech.com/index.php?page=blogger

Re: FAO Mark - Your Blog Module

Posted: Thu Jul 06, 2006 12:00 am
by Dr.CSS
sorry i needed to let it be known the tag at the bottom of the Detail template should look like this, and you need the Comments module :.


{if $return_url != ""}
{$return_url}
{/if}  id emailfield=1 websitefield=1 spamprotect=1 notify="you@yoursite.com"}

emailfield=1, websitefield=1, spamprotect=1, are optional parameters for Comments, the number 1 turns them on...

to get a count of the comments you need a User Defined Tag, call it count or whatever, it looks like this...

global $gCms;

$db = &$gCms->db;

// Get number of comments
$q = "SELECT * FROM ".cms_db_prefix()."module_comments WHERE  page_id =".$params['theid'];
$dbresult = $db->Execute( $q );
if( !$dbresult )
{
    echo 'DB error: '. $db->ErrorMsg()."";
}
$num_rows = $dbresult->RecordCount();
echo $num_rows;

and it goes in the Comment Display Template, like so... {$addcomment} [{count theid=$entry->id}]
theid is just the name i gave it you can call it what you want...
[  ] these will surround the number of comments, you can leave them in or change them if you want, it will look like this Comments [5]
if you don't leave a space between these.:  {$addcomment} [{coun  :.your number will be touching the word Comments 

sorry i didn't explain this before, i wasn't sure anyone wanted to use this as a module so i just used it my self,  hope this helps...

  mark

Re: FAO Mark - Your Blog Module

Posted: Wed Jul 19, 2006 1:29 am
by parisja
Hey nice work for the blog module.

I'll be using this soon once I get more of my site up!

Re: FAO Mark - Your Blog Module

Posted: Thu Jul 20, 2006 10:17 pm
by badhoy
Mark, could you past the code for the entire Detail template please.  I seem to have messed mine up.  Thanks.

Re: FAO Mark - Your Blog Module

Posted: Thu Jul 20, 2006 11:26 pm
by Dr.CSS
this is what mine looks like ... YMMV... there should be a restore to defaults button at the bottom of the default template page, clik and you got the original default template...
Note: you need Comments module installed for visitors to leave Comments and it is a good idea to have the spamprotect=1 it can stop spambots from over running your comments box ...
Note 2: you can modify the Comments module template to use a text area editor like tinyMCE editor with the ability to format text and add smileys  ;)  to the comments...
Note 3: the email add. at the bottom of this needs to be modified to reflect an email add. you want the notification sent to and you need CMSMailer installed for this to work...

{$entry->title}

{if $entry->category}

{$entry->category}

{/if}

{if $entry->formatpostdate}

{$entry->formatpostdate}

{/if}

{if $entry->summary}


{eval var=$entry->summary}


{/if}

{if $entry->author}

{$entry->author}

{/if}


{eval var=$entry->content}





{if $return_url != ""}
{$return_url}
{/if}{cms_module module='comments' modulename='Blog' pageid=$entry->id emailfield=1 websitefield=1 spamprotect=1 notify="you""at""yoursite""dot""com"}

Re: FAO Mark - Your Blog Module

Posted: Thu Jul 20, 2006 11:50 pm
by badhoy
Cool, thanks.  Love this module btw

Re: FAO Mark - Your Blog Module

Posted: Fri Jul 21, 2006 12:06 am
by Dr.CSS
your welcome..
it's realy just a slight rewrite of the News module..
i had a client who had to have this so...
i should rewrite the default template and add these notes in the help section...

Re: FAO Mark - Your Blog Module

Posted: Fri Aug 04, 2006 11:53 am
by zounars
Mark,

I'm using cmsms 1.0beta3  8) and the blog module (2.0.3) dont work.

I've this message when going to blog page:
Fatal error: Call to a member function on a non-object in c:\program files\easyphp1-8\www\cmsms\modules\Blog\action.default.php on line 104

I have this in line 104: while ($row = $dbresult->FetchRow())

what can I do to fix this


[attachment deleted by admin]

Re: FAO Mark - Your Blog Module

Posted: Fri Aug 04, 2006 2:10 pm
by Dr.CSS
I'm in the middle of trying to fix it now. I've got the same error.

  Thanks for your patience.
                                      mark

Re: FAO Mark - Your Blog Module

Posted: Fri Aug 25, 2006 4:53 pm
by danster
I'm kind of desperate, and was hoping for any advice you might have with the blog/comments module. I'm fairly comfortable with cmsms and know some PHP.

I've placed this mod tag
{cms_module module='blog' number="5" dateformat="%A %B %d, %Y" moretext='Comments'}
in this page.
http://www.scottpiatkowski.ca/index.php?page=blog

the summary shows up, but with no comments/more link at the bottom

i've placed this tag in the bottom of the Blog detail template
{cms_module module='Comments' modulename='Blog' spamprotect=1 pageid=$entry->id}{$addcomment}
when you click add comment, it takes you back to the summary page?

I'm using cmsms .13  Blog 2.0.3 Comments 1.5


I've been messin' with this for 3 days now. HELP!!!

Re: FAO Mark - Your Blog Module

Posted: Mon Aug 28, 2006 9:25 pm
by Elijah Lofgren
danster wrote: I'm kind of desperate, and was hoping for any advice you might have with the blog/comments module. I'm fairly comfortable with cmsms and know some PHP.

I've placed this mod tag
{cms_module module='blog' number="5" dateformat="%A %B %d, %Y" moretext='Comments'}
in this page.
http://www.scottpiatkowski.ca/index.php?page=blog

the summary shows up, but with no comments/more link at the bottom

i've placed this tag in the bottom of the Blog detail template
{cms_module module='Comments' modulename='Blog' spamprotect=1 pageid=$entry->id}{$addcomment}
when you click add comment, it takes you back to the summary page?

I'm using cmsms .13  Blog 2.0.3 Comments 1.5


I've been messin' with this for 3 days now. HELP!!!
Just a note to others. Danster and I worked this out via email. ;)

Re: FAO Mark - Your Blog Module

Posted: Fri Dec 01, 2006 7:56 pm
by badhoy
The line 104 error just popped up for me on one of my web sites.
Fatal error: Call to a member function on a non-object in /home/thehoyts/public_html/modules/Blog/action.default.php on line 104
I also get this error when trying to edit my Categories in the Blog module.
Fatal error: Call to undefined function: rowcount() in /home/thehoyts/public_html/modules/Blog/Blog.module.php on line 480
Is there a fix for this yet?  I am running 1.0.2

Re: FAO Mark - Your Blog Module

Posted: Fri Dec 01, 2006 8:54 pm
by Dr.CSS
That was for older ver. of CMSMS it's just as easy to use the News module now...

But if you want to use it go to /modules/Blog/Blog.module.php and on line 480 change rowcount to recordcount...

You need to look thru the whole file for Row/rowcount and and change them all, be sure to check for upper/lower case it's case sensitive...

Re: FAO Mark - Your Blog Module

Posted: Fri Dec 01, 2006 9:00 pm
by badhoy
Thanks for the quick response Mark.  I take it the preferred approach is now using the News Module with the comments Module.  Is there some documentation/discussion about how to best implement this?