PDA


View Full Version : A simple CMPS BLOG system


Tom M
03-21-2005, 03:08 AM
This module provides a very basic blog capability. A single thread is selected as the "blog" and posts are displayed in reverse chronological order. There are no provisions for pagination or user entries as it is intended to be a "personal" blog system. However there's no reason that users couldn't access the thread directly and add comments using the standard vb interface.

This takes about 5 minutes to install and is a module and a couple of templates. Simply configure a few settings in the module and you're set to go. Multiple blogs can be displayed on the same page by creating copies of the blog.php file and changing the default values.

I've done some light testing on this and believe it works as it should. It does not check permissions. It should count page views.

Snowy
03-21-2005, 09:11 AM
Sounds interesting, i will have a look thanks:)

yinyang
03-21-2005, 08:21 PM
works great! i have a couple questions:

1. under the table heading, "Recent blog entries" .. is it possible to make it link to the thread so people can just click on it? is there an easy code to specify rather than hard keying? i.e. tieing it to the blog.php command where you set the thread?

2. what can i do to show the user name who's blog entry it is?

PS - if you could adapt this to stand alone hack and make it so this can appear on a non-vb hack, this would easily be up for hack-of-the-month at vbulletin.org!!!

Tom M
03-21-2005, 08:50 PM
1. under the table heading, "Recent blog entries" .. is it possible to make it link to the thread so people can just click on it? is there an easy code to specify rather than hard keying? i.e. tieing it to the blog.php command where you set the thread?

2. what can i do to show the user name who's blog entry it is?I've updated the templates in the first post in this thread to include both of those features.

The header now links to the thread that is being displayed. The link points to the last post in the thread which is the most recent entry. As far as overriding the default entry goes there are directions on how to link to different threads in the first part of the blog.php file.

Also, the name of the poster shows up on each entry. Just edit the template if you don't want this to be the case.

yinyang
03-22-2005, 02:33 AM
wow, simply awesome!!!! thanks so much! if you have paypal, give me your email address so i can put what i can in.

here's your blog in action: www.bodeekount.com

Tom M
03-22-2005, 03:33 AM
wow, simply awesome!!!! thanks so much! if you have paypal, give me your email address so i can put what i can in.Glad you like it. A couple of notes for you...

To have it process the bbcodes like QUOTE, etc. change the setting of $usewysiwyg to 'false' in blog.php. Also, be sure to add 'bbcode_code, bbcode_html, bbcode_php, bbcode_quote' to the list of templates used in the module definition. It will work w/o adding the template names but they won't be cached.

For PayPal, follow the link in my sig and click on Sponsors. There's a button on the page.

yinyang
03-22-2005, 04:00 PM
i've incorporated your notes and the blog works like a charm. i've had to scratch the initial thread because my users were using it like a glorified shoutbox.

anyhow, thanks again and you should have something in your paypal.

i have one more question for you. i love the way you coded that silver line that separates each entry. what can i do to change it to an orange line?

best,
yinyang

PS - i'm going to PM you about something, so please check.

Tom M
03-22-2005, 04:42 PM
thanks again and you should have something in your paypal.

i have one more question for you. i love the way you coded that silver line that separates each entry. what can i do to change it to an orange line?Got the PP. Thank you very much.

The line I'm using is just a "Horizontal Rule <hr />" so it can really be changed to anything you like. Simply create a small orange line and set it up to display with a repeat. Alternatively, you can secify a color tag to the hr that works with IE & FF.

To display a slightly narrower orange line change the <hr /> to <hr color="orange" width="90%" align="center" /> in the adv_portal_blogbits template. If you have an exact color you want to use you may specify that as well (i.e. color="#378621").

memobug
03-22-2005, 05:01 PM
Does anyone have this in operation where it can be seen? I tried some homepage links on this page but came up dry.

Regards,

Matt

DrOwn
03-22-2005, 05:07 PM
Very nice :) This is adding 1 extra querie, anyway of pre cacheing it ?

Uncached templates: bbcode_quote (1)

Tom M
03-22-2005, 05:11 PM
Very nice :) This is adding 1 extra querie, anyway of pre cacheing it ?

Uncached templates: bbcode_quote (1)There might be. Though I've never used the post cache before.

As far as the uncached template issue see post #6 in this thread.

Tom M
03-22-2005, 05:16 PM
Does anyone have this in operation where it can be seen? I tried some homepage links on this page but came up dry.It's not really a blog but you can see it in a test module on my site (http://www.babblers.org/index.php?pg=blog&t=6663).

DrOwn
03-22-2005, 05:30 PM
I put this in the Templates Used: adv_portal_blog,adv_portal_blogbits,bbcode_quote
and it caches the template.

Heres a working demo in vba http://www.majesticforum.com/index.php?page=blog
I am useing the arcade thread untill I can get some content in to a blog thread.

Tom M
03-22-2005, 05:51 PM
Looks good.

I notice that your location of "clear.gif" isn't in the normal spot. This means the page doesn't show up properly when viewed in FF as the file is missing. Although the file is missing in IE, the page does show properly. To fix this you can either edit the templates to not use the $vboptions[cleargifurl] variable (changing it to $vboptions[bburl]/$vboptions[cleargifurl]) or make any of several other changes to get things to work.

yinyang
03-22-2005, 08:38 PM
To display a slightly narrower orange line change the <hr /> to <hr color="orange" width="90%" align="center" /> in the adv_portal_blogbits template. If you have an exact color you want to use you may specify that as well (i.e. color="#378621").

works perfect tom! thanks again. i added size="1" to thin it out. beautiful work.

Realist
03-26-2005, 11:51 AM
Cant get this to work. In the instructions it says:

Step 3.

Add your module definition using ACP -> vBa CMPS -> Add Module.

Name: Blog
File to include: blog.php
Active: Yes
Templates Used: adv_portal_blog, adv_portal_blogbits

But If I choose just the file blog.php it shows up under File to Include ok, but as soon as I input Templates Used the blog.php file disapears?

Any ideas why?

Laters

Tom M
03-26-2005, 12:05 PM
But If I choose just the file blog.php it shows up under File to Include ok, but as soon as I input Templates Used the blog.php file disapears?Be sure you are entering the template list in the "Templates Used:" section and not the "Template to Include:" section. It can be a bit tricky the first time around. If you enter a template name in the "Template to Include:" then the module is no longer selectable as you can't use both.

Deviant++
04-03-2005, 11:15 AM
mmmmm if u can put in download xml / text feature or some other nifty stuff which dont require any hacking ( just some minimal extras / perks like a blog thing ) I might use this and dump my vb blog hack ;)


(not to mention ability to filer out posts which are not mae by you IF its possible someway )

Fiber
04-04-2005, 09:12 PM
Great mod Tom M!!!

Is there anyway to remove the "RE: Thread Title" from showing up in the module?

Tom M
04-04-2005, 09:19 PM
Is there anyway to remove the "RE: Thread Title" from showing up in the module?If you don't want any of the title showing then locate the following line in the vba_portal_blogbits template and remove it.
<if condition="$blog[sectiontitle]"><strong>$blog[sectiontitle]</strong><br /></if>