Log in

View Full Version : v3Articles - vBa CMPS module


maximux1
06-16-2004, 10:00 PM
v3Article/CMPS 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

Logikos
06-17-2004, 08:57 PM
Sweet one man, Will be using this.

/me Installs

wcbryant
06-17-2004, 10:32 PM
That's slick max, on my site I think it will compliment the featured block nicely.

--edit--
On another note, I did the exact same thing in mine, then ended up removing it. You can comment out and/or delete the global.php require once, I believe. And if you replace $forumurl with $vboptions[bburl]/ in the code, then folks don't have to edit the php file at all and that can be commented out or removed too.

I'm seeing if I can edit the template now to see if it can have alternating cell bgcolors as with recent posts.

Great addition. Now if I can just figure out why mine breaks if there's no featured article...

--edit--
Got the cell alternating bgcolor working, this module is running on http://www.buckeyeplanet.com now. Thanks again Max, great addition! If you (Max) want to see my modifications, just PM me with your email and I'll shoot it over to you.

maximux1
06-17-2004, 11:39 PM
That's slick max, on my site I think it will compliment the featured block nicely.

--edit--
On another note, I did the exact same thing in mine, then ended up removing it. You can comment out and/or delete the global.php require once, I believe. And if you replace $forumurl with $vboptions[bburl]/ in the code, then folks don't have to edit the php file at all and that can be commented out or removed too.

I'm seeing if I can edit the template now to see if it can have alternating cell bgcolors as with recent posts.

Great addition. Now if I can just figure out why mine breaks if there's no featured article...

--edit--
Got the cell alternating bgcolor working, this module is running on http://www.buckeyeplanet.com now. Thanks again Max, great addition! If you (Max) want to see my modifications, just PM me with your email and I'll shoot it over to you.
thanks bro -

I tried your suggestions and didnt have much luck. Had to require global.php or I got a Fatal: Call to a member function on a non-object. Requiring global.php made it go away.

I dont believe the variable $vboptions[bburl] is in scope yet, so $forumurl is required as far as I can tell. My links did not render correctly when $forumurl was replaced with $vboptions[bburl].

looks like you would still have to edit the php file to setup the chdir() function to get global.php, or include the full path to global.php.

I'd be very interested to see the code be rewritten to not need module configuration. Would really simplify things.

Max

P.S. Im still trying to figure out how to make it so I dont have a featured article ;)

MindTrix
06-17-2004, 11:47 PM
<a href="https://vborg.vbsupport.ru/showthread.php?&threadid=66237" target="_blank">https://vborg.vbsupport.ru/showt...threadid=66237</a>

isnt it the same as this?

maximux1
06-17-2004, 11:49 PM
https://vborg.vbsupport.ru/showthread.php?&threadid=66237

isnt it the same as this?
Na, his shows part of the "featured article" in a module whereas this shows the most recent 10 articles submitted.

MindTrix
06-17-2004, 11:50 PM
oh ok, thank you for clearing that up

maximux1
06-17-2004, 11:54 PM
oh ok, thank you for clearing that up
no problem - perhaps I should try to make the description more clear.

Sorry for any confusion.

wcbryant
06-18-2004, 12:33 AM
thanks bro -

I tried your suggestions and didnt have much luck. Had to require global.php or I got a Fatal: Call to a member function on a non-object. Requiring global.php made it go away.

I dont believe the variable $vboptions[bburl] is in scope yet, so $forumurl is required as far as I can tell. My links did not render correctly when $forumurl was replaced with $vboptions[bburl].

looks like you would still have to edit the php file to setup the chdir() function to get global.php, or include the full path to global.php.

I'd be very interested to see the code be rewritten to not need module configuration. Would really simplify things.

Max

P.S. Im still trying to figure out how to make it so I dont have a featured article ;)

Just sent you the code as it's running on my site. With the alternating colors, and the other changes mentioned above. It will be interesting to see if you still get the same error messages.

Rick
06-20-2004, 02:48 AM
Have you looked at your page with Mozilla?? I'm using 1.6 and my screen resolution is 1024x768. Your page scrolls WAY... over to the right...

Bad Bunny
06-20-2004, 02:12 PM
Have you looked at your page with Mozilla?? I'm using 1.6 and my screen resolution is 1024x768. Your page scrolls WAY... over to the right...
It only seems to do that at first. If you refresh, at the last second it squishes together.

Rick
06-20-2004, 02:20 PM
Here is a screenshot after the page completley loaded.

maximux1
06-20-2004, 02:37 PM
Here is a screenshot after the page completley loaded.
Rick,
Thanks for the heads up on this. I do use mozilla but not since my last batch of changes.

Gotta do some digging to see whats causing that - again, thanks for the heads up.

Max

maximux1
06-20-2004, 02:41 PM
Rick,
Thanks for the heads up on this. I do use mozilla but not since my last batch of changes.

Gotta do some digging to see whats causing that - again, thanks for the heads up.

Max
ok, found the problem. Been having a hell of a time getting my "latest topics" block working correctly.

Back to the drawing board. oh well...

I would appreciate it if you could please confirm the format is fixed -

Thanks,
Max

Wolffman
06-23-2004, 11:47 AM
Is there any way to remove an article from the list?

Also, is there any way to change how many articles it displays? Like if I wanted to display the last 5 articles?

BeatYou
06-24-2004, 01:07 AM
Hmm is this hack avalible to those who just want to use it in a sidebar template on their page? Not with the vBadvanced CMPS system? Would be great. Thanks

maximux1
06-25-2004, 02:06 AM
Hmm is this hack avalible to those who just want to use it in a sidebar template on their page? Not with the vBadvanced CMPS system? Would be great. Thanks

You'd either have to make your own template, or slightly modify the php file to echo() or print() the contents of the mod. The just include the php file where you want it to display. Should be a quick and easy hack, id be willing to help if you need it.

Max

maximux1
06-25-2004, 02:09 AM
Is there any way to remove an article from the list?


No, not very easily. You could alter the sql command, but given the db param's I dont think you would get very far without adding a field to the articles table. Something like, 'isvisible'. Then you could alter the SQL to only pull those where isvisible = "true".


Also, is there any way to change how many articles it displays? Like if I wanted to display the last 5 articles?

Edit the php file and change the SQL statement, you will see where it says "10" - just change that to whatever number you like.

Max

Wolffman
06-25-2004, 12:28 PM
Thaks a lot!

Great hack and has became very useful. :)

PET
06-27-2004, 01:18 PM
i installed and now i get a complely white page. if i deactivate the module, it works. what i did wrong ?

PET
06-27-2004, 02:56 PM
i installed and now i get a complely white page. if i deactivate the module, it works. what i did wrong ?
Nevermind. This happend with another...module that other guy made. This module ROCKS ! IT WORKS PERFECT ! Yeeeeaaa !!

PranK
06-30-2004, 08:29 AM
good stuff!

thanks!

/me clicks install

Mone'
07-02-2004, 03:27 AM
Install working great =)

Ig@r
07-02-2004, 06:10 PM
Install, works just fine.
Thanks for sharing.

wcbryant
07-02-2004, 08:13 PM
Nevermind. This happend with another...module that other guy made. This module ROCKS ! IT WORKS PERFECT ! Yeeeeaaa !!

Yeah, the other one requires that you read and follow the instructions. ;)

Cold Steel
07-11-2004, 12:39 AM
<font color="yellow">* Cold Steel installs.
</font>

Nice hack.

Ted S
07-14-2004, 08:50 PM
Is there any way to use this hack or something like it to show the last 10 articles on the main CMS homepage in the center instead of on the sidebar? I want my ortalhome page to be more like a magazine and less like a forum with articles front and center, can it be done?

kira
07-15-2004, 06:44 AM
Very nice work, [b]maximus1[b]. Easy install, clear instructions, and works like a dream. Many thanks!

nelto
09-13-2004, 07:21 AM
ok I have this installed and integrated with vba, but....

I cant see text on the vba.
Any ideas?

LPH2004
10-10-2004, 04:49 PM
ok I have this installed and integrated with vba, but....

I cant see text on the vba.
Any ideas?

Actually, that is the "featured article" and not the "most recent articles" ... And I get the same problem with the featured one but not this hack. It seems to work fine.

lakers6473
10-15-2004, 08:06 AM
Next, create the new module using the drop down menu selecting "cmps-articles.php".

still new to vb, i'm trying to install vbarticles but i'm stuck on this one part.

where do i create the module to insert the templates?

weirdpixels
10-19-2004, 07:36 PM
thanks, it works great :)

eViL_sTiGmA
08-06-2005, 05:55 PM
Well i installed it and i get this error...

Fatal error: Call to undefined function: getrowcolor() in /home/gamerz/public_html/forum/modules/cmps-articles.php on line 17

I did everything the instruction says twice, but i get the same error. What can i do??