vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 02-18-2005, 04:41 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default [1.0.1] CMPS Articles Module

What it does.

This module provides the ability to display a directory of "articles" using VB threads/posts as the article source. Articles may also be displayed via the directory capability or directly as indicated below. This means anything that can be placed into a post can be used as an article.

Articles may be accessed in one of 2 ways.

1. Directly by post id. To display post number 31982 use
/index.php?page=article&p=31982
2. Directly by thread id. To display the first post in a thread use
/index.php?page=article&t=5117
It is possible to display the 'n'th post in a thread as a page. The page order is based on the post id. To display the 5th page use
/index.php?page=article&t=5117&p=5
The thread title will be used as the name of the page except when displaying a specific post or page number. In that case the post title will be used if one exists. This works well in the case where a thread is set up with multiple chapters.

If the requested entity can't be found the page will be empty.

To display a directory of articles for forum id 37 use
/index.php?page=article&f=37&dir
Available options are 'dir=recent' for the 'n' most recent articles and 'dir=popular' for the 'n' articles with the most views. These choices are provided automatically when doing a directory listing. . Also available is 'dir=author' which results in articles being displayed sorted by author and title.


View counts are updated when articles are referenced directly by postid as in #1 above or when accessed only by threadid only as in #2 above. This means once a user is reading a multi-page article the view count won't keep increasing.

When accessing articles via the thread id navigation links will be automatically provided at the bottom of the article. This will allow a user to easily read through a multi-chapter article.

Also supported is the ability for the breadcrumb information to reflect the actual page name instead of the generic page name. For this feature to work properly the vba_cmps_include_bottom.php must be modified by moving a section of code. If you don't wish to use the feature simply delete or comment the code that is clearly marked (begin-end) near the end of the article.php file.

What it doesn't do.

This isn't intended to replace a full-blown articles system. However for users that only need the basics then this should work fine. The advantage for this module is that no additional hacking of VB is necessary to make things work.

How would I use it?

One way to use this could be for multi-page help system, news items or articles.

As one example, the thread title could be "My Summer Vacation" and the post titles could be the chapter names.

Pages may consist of any content you can fit into a VB post, including inline images.

Installation

Installation is straight forward. Simply download and follow the "article installation.txt" file. The other file that is needed is the article.php file. This file needs to be installed in the modules directory.

The article.php file will check forum permissions if the $checkperms variable is set to true. If the user does not have permission to view the forum where the article is contained then it will not be displayed. Turning this 'off' allows the module to process forums where the user doesn't normally have access - but still needs to see the content via the front-end display.

Using the system.

Using the system is pretty simple. Create a thread/post. You may use a separate forum with restricted permissions if desired. The first attached image will be used as the article icon at the top of the article display. There are currently no provisions for accessing more than one attached image.

When referencing an article via the thread id additional navigation links will be automatically provided at the bottom of the article if there are additional pages to be displayed.

Dealing with Permissions

If the variable $checkperms is set to 'true' then users will be provided an error message if they do not have sufficient permission to view the Articles forum. However, if $checkperms is set to 'false' then users will be able to read articles regardless of the forum permissions. Users must have explicit permission to access attachments. Setting $checkperms to 'false' does not remove this restriction.

UPDATES

23-Feb-2005
  • Works with CMPS 1.0.0 or 1.0.1
  • Supports paged directory listings.
  • Ability to specify a default article image.
  • Ability to access the article via the link or image, if one exists.

CAVEAT:
For the paging system to work you must change the CMPS default Page Variable from 'page' to something other than 'page'. A good choice would seem to be 'pg' as the rest of VB doesn't seem to make use of it.

This is necessary as the vb page navigation makes use of the 'page' argument internally so it's not possible to have it the same. Anything can be used in its place as the templates and application are dynamically driven.

If you have any other modules that are hard coded they may be changed by substituting the value of $vb_options['portal_pagevar'] instead of 'page'.

24-Feb-2005
  • Added header information to directory listing.
  • Corrected problem with image being clipped on IE.
  • Added support for rating articles.

26-Feb-2005
  • Improved navigation links in directory header. The breadcrumb navigation now uses the forum name instead of the generic "Articles" name
It's only necessary to replace the article.php module. No templates were changed.

1-Mar-2005
  • Added an "index" template that can be used to display Featured Articles and links to Categories where articles are stored for easier access.
  • Added new configuration parmeter to article.php to optionally disable the display of the top page navigation. This is useful when the article directory is displayed on a page with other content.
It's only necessary to replace the article.php module and create the new template if desired. After creating the new template follow Step 4A in the instructions. No other templates or changes were made.

3-Mar-2005
  • Enhanced the directory listing to include both the Forum name as well as the Forum description in addition to the number of articles available.
It's only necessary to replace the article.php module and replace the adv_portal_article_listing template.

30-Mar-2005
Upgraded to make more flexible when dealing the article icons.
  • Created new configuration parameter $stripthumbnail to control whether the first thumbnail image should be displayed in the list of thumbnails.
  • Created new configuration parameter $useicons to control whether or not the thread icon should be used as the article image if no image thumbnail images are present.
  • Changed things so a directory listing is the default operation if no other arguments are provided.
As supplied the new variables are configured so that there is no change in operation other than the directory listing being the default operation.

To upgrade from a previous release simply replace the article.php file and set the new configuration paramters to your desired settings.

5-Apr-2005
  • Added navigation links to previous/next article. The 'Previous' article will always be the article created before the currently displayed article. The 'Next' article will always be the article created after the current article.
  • Created new configuration parameter $showarticlenav to control whether or not the article navigation links should be displayed.
As supplied, the new configuration parameter is set so that article navigation links are active.

To upgrade from a previous release replace the article.php file and set the new configuration paramters to your desired settings. It is also necessary to update/replace the adv_portal_article template to make use of the article navigation links.

18-Apr-2005
  • Updated references to "index.php" to be dynamically driven. This allows the module to be used with almost any file name (i.e. cmps_index.php)
To upgrade from a previous version replace the article.php file as well as the adv_portal_article, adv_portal_article_listing and adv_portal_article_index templates.
Attached Images
File Type: jpg article.jpg (45.3 KB, 2837 views)
File Type: jpg article-index.jpg (25.9 KB, 2162 views)
File Type: jpg article-directory.jpg (42.1 KB, 2001 views)
Attached Files
File Type: zip article.zip (11.8 KB, 883 views)
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.

Last edited by Tom M; 04-18-2005 at 04:19 PM. Reason: Updated: Loaded most recent version
  #2  
Old 02-19-2005, 01:46 AM
shiva shiva is offline
Member
 
Join Date: Oct 2004
Posts: 47
Default Re: CMPS Articles Module

Nice, simple, but two things.

No main menu? Guess we would have to link it by hand

Other though, only one image attachment shows, any others do not, and kind of need that as a lot of my articles have several screenshots.

One thing I did notice, loads VERY fast, so nice job. If you can tell me how to have my attachments displayed, appreicate it
__________________
shivaSite
Pinball - The silverball addiction
  #3  
Old 02-19-2005, 02:32 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

I'm actually working on the next release now which will provide a directory capability. Simply define a forum to be the article repository and a directory will be provided. The step after that is to decide how to best handle categories.

Attachments are another issue. I need to give some thought on what's the best way to handle them. Inline images are no problem btw.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #4  
Old 02-19-2005, 04:41 AM
shiva shiva is offline
Member
 
Join Date: Oct 2004
Posts: 47
Default Re: CMPS Articles Module

Cool, that's nice news. I'm looking at the new geek articles, and my eyes glazed over soon as I saw the amount of hacks needed. yow...

I did notice something though. I have a couple links in my Navbit to new threads, and view your posts. I noticed that the link changed with this, on every page but this article, to point properly (I have my forums in a subdirectory) but with pages generated with this, it removes the "forum" link, and ends up causing a error page.

So instead of http://www.shivasite.com/forums/search.php?do=getnew
I get http://www.shivasite.com/search.php?do=getnew just when I use your script.

Sample page: http://www.shivasite.com/index.php?page=article&t=894

Update: just checked, all my page links that would normally go to the forum folder go to the root instead, including the quick links drop down. Any Ideas?
__________________
shivaSite
Pinball - The silverball addiction
  #5  
Old 02-19-2005, 04:51 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

Did you do the edit of vba_cmps_include_bottom.php as described in the install file?

BTW - I've got thumbnails working and should be able to upload the new package in the next 12 hours or so.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #6  
Old 02-19-2005, 10:33 AM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

I'll use this too


should I wait for the new one ?

Last edited by Deviant++; 02-19-2005 at 10:38 AM.
  #7  
Old 02-19-2005, 04:30 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

I have uploaded the new files to the first post.

The new files provide capability to generate 3 styles of directory listings (Complete, Most Popular, and Most Recent) and display articles along with all attachments the article may have.

I'm wouldn't be surprised if there may be one or 2 (or more) problems even though I did test it fairly well. Give it a try and let me know how it goes.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #8  
Old 02-20-2005, 06:32 AM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

http://forums.deviatedhq.com/index.p...e=article&t=53

Errors :

1. Had to set the permissions to false cause otherwise it wasn't letting me see the article.

2. The 1st attached image isn't showing up as a picture.

3. The directory listing dosn't seem to be working..
  #9  
Old 02-20-2005, 10:18 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

Thanks for the feedback. Did you get a "No permissions" error page?

1. What permissions do you have set on the forum?

2. Same thing. If you don't have permission to view attachments then you won't see the attached pictures.

3. A bit more info than "not working" is needed . If you don't have permission to see the forum then you won't be a ble to get a directory listing.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #10  
Old 02-20-2005, 11:51 AM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

all permissions are go for admin, and even the admin ( me ) couldn't read when it was set to true..

permission for admin is 'go' to everything as in total control.. and I'm the admin..

and the not working thing, umm, well I'm putting in dir=recent, or any other variant, it's just a blank page.
  #11  
Old 02-20-2005, 12:09 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

Very odd. I have it running semi-live on my site and it works fine with permissions being checked. Isn't that always the case

With permissions being checked do you get an error screen?

Can you send me a link so I can take a look? Feel free to pm me if you prefer.
  #12  
Old 02-20-2005, 02:26 PM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

it says u do not have permission to access, plus the attached image also didn't show up when I disabled permissions ( also admin account as go for everything, no 'no's to any permissions anywhere in acp )
  #13  
Old 02-20-2005, 02:48 PM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

ok looks like I got the 'dir' working and that solved the permissions page
this is what I have right now

$checkperms = false;

// Set $articleforum to the forumid where your articles are stored.
// This is only used for the directory listing.

$articleforum = 34;



Probs:

1. the image isn't showing up ( attachment as the upper left pic ) ( coming as a red x )
eg
normal: http://forums.deviatedhq.com/showthread.php?t=53
article: http://forums.deviatedhq.com/index.p...e=article&t=53

2. The pages keep dont end, they flow into another 'frumdisplay' eg =3 ( not in article format, normal posting one )

3. I'm gonna be using different forums as my articles forums, not one.

Is there anyway the dir can be made to show dynamic in url rather than changing code for 'one' forum in the php file.



Great hack though I'm gonna love using it, I'm sure it'll be much more spider friendly too.

Suggestions : display thread rating on article rating and ability to rate while viewing it as an article too.
  #14  
Old 02-20-2005, 03:11 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

The directory forumid could be made as a command line argument.

OTOH - if you just want to pull the directory for multiple forums changing
PHP Code:
$articleforum 52
to
PHP Code:
$articleforum "52,2,75"
and
PHP Code:
WHERE forumid $articleforum AND visible 1"; 
to
PHP Code:
WHERE forumid IN ($articleforum) AND visible 1"; 
should do the trick.

To make it settable via the command line would take a bit more coding change.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #15  
Old 02-20-2005, 03:19 PM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

im testing but itm, if all the dir's appear in the same window, it'll mix up category / subjects..
  #16  
Old 02-20-2005, 03:22 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

I've uploaded a new article.php which might (should?) take care of you missing thumbnail. If not I'll work on it some more tonight. Gotta go.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #17  
Old 02-20-2005, 03:23 PM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

*just read ur new post, I wrote this before I read about the new file, I'll try i now.


http://forums.deviatedhq.com/index.php?page=article&dir

Parse error: parse error, unexpected ',' in C:\Inetpub\vhosts\deviatedhq.com\subdomains\forums\httpdocs\modules\article.php on line 78












code is:
$checkperms = true;

// Set $articleforum to the forumid where your articles are stored.
// This is only used for the directory listing.

$articleforum = 35,41;

// See if the user can access the forum at all
$articleperms = fetch_permissions($articleforum);
if ($checkperms AND !($articleperms & CANVIEW))
print_no_permission();

// Set $dateformat to your preferred date layout

$dateformat = "M d, Y";

unset($sqlquery, $sqltype);

$displaypage = 1;

if (isset($_REQUEST['dir']))
{
// generate a directory listing
$sqltype = 'dir';

$sqlquery = "SELECT threadid
FROM " . TABLE_PREFIX . "thread AS thread
$deljoin
WHERE forumid IN ($articleforum) AND visible = 1";
  #18  
Old 02-20-2005, 03:33 PM
Deviant++'s Avatar
Deviant++ Deviant++ is offline
Senior Member
 
Join Date: Dec 2004
Posts: 216
Default Re: CMPS Articles Module

Quote:
Originally Posted by Tom M
I've uploaded a new article.php which might (should?) take care of you missing thumbnail. If not I'll work on it some more tonight. Gotta go.

nope, it might be the dimensions..?
  #19  
Old 02-20-2005, 09:07 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

When using the multiple forumid variation it's necessary to enclose the numbers with quotes (i.e. $articleforum = "35,41"; ).

No matter. I just updated the article.php file with a version that supports specifying the forumid. If specified then that forum will be scanned. If not specified then the default forum will be scanned. Simply add the '&f=35' to the directory request to get a directory listing of forum #35.

As far as the thumbnails go, if you are seeing the images as attachments when viewing as normal posts then you should see them in the article posting as the module uses the same postbit code to generate the attachment portion of the article.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #20  
Old 02-20-2005, 09:45 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: CMPS Articles Module

Ah. I think I figured it out. My guess is that you don't have thumbnails enabled. It's the thumbnail that's used for the image in the header portion and in the directory listing.

I've uploaded a version that checks to see if thumbnails are enabled and if they aren't then it uses a blank image. Give it a try and see if it fixes your situation. Of course you could also enable thumbnails .
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
v3Article Module - Last 10 Articles maximux1 Add-On Modules & Modifications 69 06-06-2005 03:36 PM
[request] most read articles ttnb Add-On Modules & Modifications 7 11-17-2004 07:02 AM
VBA Articles? tfw2005 Site Feedback & Updates 9 10-14-2004 02:51 PM
Wrap CMPS modules around V3 Articles? tfw2005 Troubleshooting / "How do I..." Questions 4 08-27-2004 04:55 PM
cmps_index.php and articles.php RSimpson Troubleshooting / "How do I..." Questions 6 06-06-2004 03:40 PM


All times are GMT -4. The time now is 01:36 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.