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 06-17-2004, 03:55 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default v3Article Module - Last 10 Articles

This CMPS module uses the excellent v3Article system developed by John Warwick. The module displays the 10 most recent articles submitted, in DESC order, (Last article submitted is first in list).

This module also includes the author of the article with a link to his pubilc profile and how many views the article has had.

You can vie the module in action on the right hand side of http://www.marijuana.com - the module is titled "The Magazine".

http://www.marijuana.com

You'll need to upload the php file to your modules directory and create two new templates named "adv_portal_articles" & "adv_portal_articlesbits". Add the contents of the respective text files to the new templates and save. Next, create the new module using the drop down menu selecting "cmps-articles.php". In the "templates used" field enter the following templates.

adv_portal_articles,
adv_portal_articlesbits

Dont forget to update your index pages(s) to show the new module.

Special thanks to wcbryant, who's help has shed new light on vB development for me. Im very grateful for your code additions and help.

Maximux1
Marijuana.Com
Attached Files
File Type: zip cmps-articles.zip (2.1 KB, 385 views)
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist

Last edited by maximux1; 06-17-2004 at 11:00 PM. Reason: New package uploaded
  #2  
Old 06-17-2004, 05:32 PM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

lol


U bugger you beat me too it

V nice addon m8

Thanks a lot for this your a star.

H
  #3  
Old 06-17-2004, 05:41 PM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

I am getting a parse error on line 41 ?
  #4  
Old 06-17-2004, 05:49 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

Quote:
Originally Posted by Shack Networks
I am getting a parse error on line 41 ?
Make sure there is no white space after the ending ?>

Sometimes that will cause the error you are speaking of. My file only has 41 lines...

Let me know if you would like for me to re-upload the working version that is on my site.

Max

p.s. Heh, I figured someone was banging away at that - there's a ton more to be done, though. See my more general thread about v3articles (http://www.vbadvanced.com/forum/showthread.php?t=1356)
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #5  
Old 06-17-2004, 05:52 PM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

Nope no white spaces Please can you upload yours and I will give that a try.

H
  #6  
Old 06-17-2004, 06:02 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

I've uploaded a new package - could you please give that a try for me? Should just have to overwrite cmps-articles.php in the mods dir.

thanks!
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #7  
Old 06-17-2004, 06:09 PM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

Ok that worked fine, I had to alter the table name to add the prefix though

/* Performing SQL query */
$result = $DB_site->query("SELECT articleid, title, commentcount, articleusername, articleuserid, views FROM vb3_article ORDER BY articleid DESC LIMIT 10");

Its working just fine now though thanks

H
  #8  
Old 06-17-2004, 06:10 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

ah, good point, didnt think about table prefix users -
I'll fix that and updated the original file.

Thanks for pointing that out and your help!

Max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #9  
Old 06-17-2004, 06:14 PM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

Hey No Probs, thanks for the hack

I am gonna add this together with the featured article hack and combine them into one nice block for the center, I will post it up when and if I get it fone

H
  #10  
Old 06-17-2004, 06:17 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

Hey, that sounds like a great idea! Looking forward to it

btw, i've updated the original package to support table prefix's and that parse error.

Max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #11  
Old 06-17-2004, 07:04 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

Script has been edited to no longer show articles waiting to be moderated.

Max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #12  
Old 06-18-2004, 05:12 AM
Shack Networks Shack Networks is offline
Junior Member
 
Join Date: May 2004
Posts: 18
Default Re: v3Article Module - Last 10 Articles

OK I was gonna merge both hacks together into one PHP script but realised that the authors may not like that too much so I decided to go via the templates route and add them together in one block.

I came up with the block bellow, if anyone wants to know how to do it then I will gladly sort out some instructions and post up my templates etc...

I am gonna play about with it later today and make it look a bit nicer but at the moment this is active on my site and fully functional. I would love it however if the featured article script could be made to display the first image [Thumbnailed] in the aricle thread in the block as this would be the icing on the cake for me.

Remember its not too complex to acomplish but I would sooner both autors merge thier hacks together and works as one as this is one nice little addition .

OH BTW MaxiMux your site is kewl m8, /me heads off for a smoke

H
Attached Images
File Type: jpg articlecenter.JPG (56.6 KB, 585 views)

Last edited by Shack Networks; 06-18-2004 at 05:22 AM.
  #13  
Old 06-21-2004, 04:59 AM
ixian ixian is offline
Junior Member
 
Join Date: Feb 2004
Posts: 28
Default Re: v3Article Module - Last 10 Articles

Maximux1, thanks for the excellent addon. Nice site, btw.

If you don't mind me asking, what did you need to do to get the articles themselves integrated with VBA CPMS? I notice all your articles have your left sidebar present when viewing rather than taking up the entire page; I am trying to do the same myself. Any pointers?

Thanks again.
  #14  
Old 06-21-2004, 10:45 AM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

Thanks, ixian -

Well - I guess Im not exaclty sure what you're talking about. I have made some changes over the weekend and slightly modified the frontpage so it may be different that what you were speaking of.

Be sure to read the instructions carefully. Once you have the module created you can move it anywhere you like on the page using the vBa CMPS module editior.

Happy to help further if I can.

Max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #15  
Old 06-21-2004, 01:24 PM
ixian ixian is offline
Junior Member
 
Join Date: Feb 2004
Posts: 28
Default Re: v3Article Module - Last 10 Articles

No no, I'm not talking about your module - I'm talking about the article addon itself. You appear to have modified it.

What I mean is, when I read the full article, like, say, this one:

http://www.marijuana.com/420/article.php?a=11

You have the vba CPMS left sidebar still showing, with your main menu, etc, blocks. The normal Articles addon doesn't do that. I was wondering what you changed.

Thanks!
  #16  
Old 06-21-2004, 01:54 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

oh oh oh - sorry, I get what you mean, now.

What I did was first, create a new page in vBa CMPS - call it whatever you like, for the page identifier, I used "magazine" - again, use whatever you like.

Once you have created the new page in CMPS, you'll need to edit article.php, like so...

At the very bottom of article.php you will find the following two lines...

PHP Code:
// articles main page eval
eval('$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('ARTICLES') . '");'); 
Replace those two lines with the following lines;

PHP Code:
eval('$HTML = "' fetch_template('ARTICLES') . '";');
print_portal_output($home$HTML); 
Now, your articles will be displayed within the scope of vBa CMPS.
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #17  
Old 06-21-2004, 02:02 PM
ixian ixian is offline
Junior Member
 
Join Date: Feb 2004
Posts: 28
Default Re: v3Article Module - Last 10 Articles

Huh. Clearly I am doing something wrong.

I created a new page in CMPS, called it magazine just for testing, added the file edits, now I get a blank page for article.php.

I think the instructions above are missing something? How does that tell article.php to use the new CMPS page?
  #18  
Old 06-21-2004, 02:04 PM
ixian ixian is offline
Junior Member
 
Join Date: Feb 2004
Posts: 28
Default Re: v3Article Module - Last 10 Articles

Update: The error message I get when I turn on error messages in php is:

Fatal error: Call to undefined function: print_portal_output() in /var/www/html/forums/article.php on line 1291

Which makes sense, because that doesn't appear to be an existing function. What am I missing?
  #19  
Old 06-21-2004, 02:31 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

ah - I forgot to have you add the following code to the TOP of article.php

PHP Code:
<?

define
('VBA_PORTAL'true);
define('VBA_PAGE''magazine');

...
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
  #20  
Old 06-21-2004, 02:33 PM
maximux1 maximux1 is offline
Senior Member
 
Join Date: Feb 2004
Posts: 101
Default Re: v3Article Module - Last 10 Articles

Add those two lines to the top of article.php and that should fix ya up.

Let me know if your still having problems.

max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish."
-- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist
 


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
Weather Module cLord Add-On Modules & Modifications 157 09-08-2006 07:50 PM
Scoreboard Module juanchi Add-On Modules & Modifications 60 06-14-2006 10:43 AM
Basic Module cLord Add-On Modules & Modifications 55 04-24-2006 08:45 AM
Module: Countdown to certain date 58sniper Add-On Modules & Modifications 36 10-26-2005 01:57 PM
Module: Virus Map 58sniper Add-On Modules & Modifications 9 06-05-2005 05:14 AM


All times are GMT -4. The time now is 10:47 PM.

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.