PDA

View Full Version : [ADDON] cinq's vbArticles Latest 3 Featured Articles CMPS Module


cinq
02-21-2005, 10:00 PM
A small addon to show the latest 3 featured articles on your Portal page.
This add on CMPS module is for cinq's vbArticles Hack v2.0 (https://vborg.vbsupport.ru/showthread.php?t=74189)

Hack version 1.1

Install instructions
===========================================

1. Upload the cmps-articles.php file to your modules directory.

2. Create 2 new templates:

a. First template:

adv_portal_articlesbits

<tr>
<td class="$getbgrow" width="100%">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="0" class="tborder" width="100%">
<tr>
<td width="20%" align="center">$articonimg</td>
<td width="80%" align="left"><span class="smallfont"><b>Title: <a href=$vboptions[bburl]/articles.php?action=viewarticle&artid=$articleid>$title</a></b>
<br>$summary</span></td>
</tr>
</table>
</td>
</tr>


b. Second template:

adv_portal_articles

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] Featured Articles</strong></span></td>
</tr>
$articlesbits
</table>
<br />


3. Next, perform the following file edits.

a. In your global.php file

FIND

$specialtemplates = array_merge($specialtemplates,
array(
'adv_modules',
'adv_portal_opts',
'attachmentcache',
'bbcodecache',
'birthdaycache',
'eventcache',
'iconcache',
'maxloggedin',
'smiliecache',
'userstats'
)
);


REPLACE WITH

$specialtemplates = array_merge($specialtemplates,
array(
'adv_modules',
'adv_portal_opts',
'attachmentcache',
'bbcodecache',
'birthdaycache',
'eventcache',
'iconcache',
'maxloggedin',
'smiliecache',
'userstats',
'vbart_options'
)
);

Save and upload global.php


b. In your includes/vba_cmps_include_top.php file

FIND

$portalopts = unserialize($datastore['adv_portal_opts']);


ADD ABOVE

$vbart_options = unserialize($datastore['vbart_options']);
unset($datastore['vbart_options']);

Save and upload includes/vba_cmps_include_top.php


4. 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'

5. Don't forget to update your index pages(s) to show the new module.

6. Done !

===========================================

Enjoy :)
- cinq

ptmuldoon
02-22-2005, 02:07 PM
Works great, except I had to modify the cmps-articles.php file on line 20 to correct for the image not showing on the home page. They originally showed only if you were within your forums page. Thus, I edited it to this

$articonimg = "<a href=\"$vboptions[bburl]/articles.php?action=viewarticle&artid=".$articleid."\"><img title=\"".$title."\" src=\"$vboptions[bburl]/articles.php?action=thumb&artid=".$articleid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth']."></a>";

KTBleeding
02-22-2005, 02:33 PM
Thanks cinq.

And thanks ptmuldoon, I was just going to come report that..

cinq
02-23-2005, 08:25 AM
Thanks for the feedback guys, I have editted the file and reuploaded it.

For those who installed this add-on prior to the date/time of this post, just download the attachment again, and upload it, overwriting your existing cmps_articles.php file.

shadiguy1
02-23-2005, 11:20 AM
hmm i did didnt show up tho. im looking into it.

cinq
02-25-2005, 03:42 AM
Made some code change in the cmps-articles.php file.
If you had previously installed this add-on ( v1.0 ) please download the attachment ( v1.1 ) and upload it to your modules folder, overwriting the old file.

Everything else ( other steps highlighted in the first post ) remains the same.

ncangler
02-25-2005, 04:28 AM
Cinq, I cannot thank you enough for all the great work you'd put into this Articles system. I love it and it has added so much potential to my site. Thank you!

Chief Corn
02-25-2005, 08:39 AM
i'm not the greatest with html, so any chance someone can make a template to list horizontally as is done in the main article index? i'd appreciate it. excellent hack.

cinq
02-28-2005, 10:44 AM
You mean in columns instead Chief ?

yannisc
02-28-2005, 06:55 PM
Hi!

How can I make the image of the article on the main page be wrapped from the text rather than be left and the text right?

There was a hack that did something similar for the news posts on the vbadvanced cmps. Can we make the same here?

thanks, Yannis

Chief Corn
02-28-2005, 07:57 PM
You mean in columns instead Chief ?

yes. with my site the news already takes up alot of the row space.

Deviant++
03-01-2005, 09:13 AM
I'm getting an error when I'm putting in the include file.

the article system says syntax error 1064 and the cmps portal dosn't display images.

misticjeff
03-04-2005, 09:27 AM
You mean in columns instead Chief ?
I'd also like to see perhaps 3 recent articles all in one row on the CMPS home instead of each article using it's own row. This way I could feature it in the center column above the news right at eye level without taking up too much precious real estate.

lwhite
03-13-2005, 04:55 AM
I followed the instructions, but it did not showing up on my portal. Any suggestions?

When I try to add the module, i get the following SQL error:
Invalid SQL: UPDATE 1adv_modules SET title = 'Latest Articles', identifier = 'latestarticles', filename = 'cmps-articles.php', displayorder = '4', modcol = '2', inctype = '0', templatelist = ''adv_portal_articles, adv_portal_articlesbits'', userperms = '1,2,3,4,5,6,7,8', active = '1' WHERE modid = '14'
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'adv_portal_articles, adv_portal_articlesbits'', userperms = '1,

mysql error number: 1064

Date: Sunday 13th of March 2005 02:01:09 AM
Script: http://www.slackerssoapbox.com/forums/admincp/vba_cmps_admin.php
Referer: http://www.slackerssoapbox.com/forums/admincp/vba_cmps_admin.php?do=editmodule&modid=14

ccplim
03-13-2005, 07:50 AM
Nice one. Installed on my test machine and it works perfectly.

Btw, is it possible to display the beginning portion of the article (say, the first 1000 words)? I noticed mine only display the article title and summary.

deb0
03-14-2005, 02:44 AM
Nice one. Installed on my test machine and it works perfectly.

Btw, is it possible to display the beginning portion of the article (say, the first 1000 words)? I noticed mine only display the article title and summary.

Excellent, u read my mind! I need the same thing.

YLP1
03-17-2005, 06:02 PM
I have a slight problem...the paths with this mod have the admin section as admincp my admin folder is just admin....

I removed the cp from the install files but I can't get the mod to update the templates etc.

Is there a way to uninstall this, correct the admin path and then reinstall?

cobraclub
03-18-2005, 12:26 PM
Does this only display featured articles, or can it be configured to display latest articles, if so, how?

Many thanks and great hack.

RichieBoy67
03-21-2005, 09:21 PM
Will this work with VBPortal???

Aceman
03-27-2005, 08:54 PM
I could definately use a column version of this hack.

Aceman

Blam Forumz
03-27-2005, 10:12 PM
is it possible to make it look like how the features articles bit looks on the actual articles section?

Blam Forumz
03-27-2005, 10:38 PM
Ok, i've done a bit of editing heres my templates:

adv_portal_articles


<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td class="tcat" align="left">$vbphrase[vbart_featured]</td></tr>
<tr>
<td class="alt2" align="left" valign="top">
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="left">
<tr>$articlesbits</tr>
</table>
</td>
</tr>



and

adv_portal_articlesbits


<td valign="top" align="center" class="alt1" width="20%">
<a href="articles.php?action=viewarticle&artid=$featuredid">$articonimg</a><br>
<a href="articles.php?action=viewarticle&artid=$featuredid">
<span class="smallfont"><b>$title</b></span></a>
</td>



But look at my index:

www.blaminator.co.uk

the tables are touching, if i add a <br> it messes everything up :/

synn
03-28-2005, 10:20 PM
the tables are touching, if i add a <br> it messes everything up :/


At the end of "adv_portal_articles" add:

</table><br>

I like it displayed better this way. :up:

Thanks for the idea! :)

jzewatsky
03-31-2005, 10:33 PM
Is there a way to change the display order of the featured articles so that the most recient article is on top?

subnet_rx
04-01-2005, 05:45 PM
Cinq, I cannot thank you enough for all the great work you'd put into this Articles system. I love it and it has added so much potential to my site. Thank you!

I've got to agree. Great work, please keep it up.

ncangler
04-05-2005, 08:51 PM
I've installed on my 3.0.7 and CMPS 1.0.1 site (www.triumphowners.org) and image shows up fine in the Articles page but not on the CMPS portal page. I installed the revised cmps_articles.php file but no good. CMPS portal page seems to load slower now too. Any help is most appreciated.

Princeton
04-05-2005, 08:55 PM
I've installed on my 3.0.7 and CMPS 1.0.1 site (www.triumphowners.org) and image shows up fine in the Articles page but not on the CMPS portal page. I installed the revised cmps_articles.php file but no good. CMPS portal page seems to load slower now too. Any help is most appreciated.
I notice this is using the datastore ... make sure you upgrade your PHP to version 4.3.11. 4.3.10 has an unserialize() bug. You should see a noticable difference when you do.

ncangler
04-05-2005, 09:10 PM
Thanks for the quick reply Princeton. What is the datastore? I assume I'd have to ask my server supplier to upgrade the PHP, but any concerns on affecting anything else if they do?
Randy

I notice this is using the datastore ... make sure you upgrade your PHP to version 4.3.11. 4.3.10 has an unserialize() bug. You should see a noticable difference when you do.

Princeton
04-05-2005, 09:13 PM
there shouldn't be any problems .. it's a simple upgrade

You do not need to do anything on your end.

ncangler
04-05-2005, 09:29 PM
Thank you for the suggestion. I have already emailed them asking that this be done. :)

there shouldn't be any problems .. it's a simple upgrade

You do not need to do anything on your end.

subnet_rx
04-06-2005, 07:03 PM
I've installed this hack but can't get it to show up, what should I check? What do you mean by refreshing the index page? I'm using vBAdvanced.

EDIT: I just installed the top_rep hack for vBA with no problems. The box for this hack isn't even showing up.

ncangler
04-08-2005, 02:52 AM
I've installed everything identical to my 3.0.5 setup on another site but this 3.0.7 install doesn't show the image on the CMPS page. It shows fine within the Articles portion of the site. (www.triumphowners.org)

Any ideas?

ncangler
04-08-2005, 02:54 AM
In the attached photo you'll notice that there is a larger border on the middle of three articles being featured on the CMPS page. How can I change the border on the center display so that all three featured articles look the same? Thanks!

I'll bet it is the alternating colors 1 and 2 isn't it? How would I override that for this display?

ncangler
04-08-2005, 03:12 AM
I'm stumped. I've done everything I can think of but the image does not show up on the CMPS page. I've attached an image showing the article image displayed on the ARticles page and an image that shows the image no show on the CMPS.

It is very strange cause it works on one of my sites but not the other. The files on both sites are identical (except path info). The only difference between the two sites is that the one that works is running vBulletin 3.0.5 and the one that doesn't is running 3.0.7. Any ideas are appeciated. Thanks.

ncangler
04-08-2005, 03:16 AM
Be sure to activate the new module (mine is called "Featured Articles") in your AdminCP (vBa CMPS, Edit Modules, Featured Articles). Then you need to make sure it is turned on for the particular page where you want it to appear. I have mine on my main page so I edit the Default/Home Page (AdminCP, vBa CMPS, Edit Pages, Default/Home Page). Hope this helps!

I've installed this hack but can't get it to show up, what should I check? What do you mean by refreshing the index page? I'm using vBAdvanced.

EDIT: I just installed the top_rep hack for vBA with no problems. The box for this hack isn't even showing up.

subnet_rx
04-08-2005, 05:31 PM
yep, both are checked. I may move away from this system anyway, since it will be paid in the future.

redcow
04-10-2005, 12:05 PM
thanks

ncangler
04-12-2005, 12:21 AM
Okay I've got to quit working on the computer so much. I found the problem. Somehow in the process of editing three sites I forgot to add the vba_cmps_include_top.php edit. Sorry!

I'm stumped. I've done everything I can think of but the image does not show up on the CMPS page.

TTG
04-14-2005, 01:59 PM
Installed and module shows without picture .. when I try and add the vba_cmps_include_top.php edited file I receive error :-

Database error in vBulletin 3.0.6:

Invalid SQL:
SELECT a.title, a.articles_articleid, a.icon, SUM(r.rating) / COUNT(r.rating) avg
FROM articles_article a
LEFT JOIN articles_rating r
ON a.articles_articleid = r.articleid
WHERE a.featured=1
GROUP BY a.articles_articleid
ORDER BY RAND()
LIMIT

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 8

mysql error number: 1064

kissmans
06-10-2005, 12:26 PM
please tell me what happen when i install it.



SELECT a.article_articleid, a.title, a.summary, a.iconid
FROM nhactinhvienxu_us_-_diendan.article a
LEFT JOIN nhactinhvienxu_us_-_diendan.article_category c
ON a.categoryid = c.article_categoryid
WHERE a.categoryid != '0' AND a.draft !='1' AND a.featured=1
ORDER BY a.publishdate DESC
LIMIT 3
mysql error: You have an error in your SQL syntax near '-_diendan.article a
LEFT JOIN nhactinhvienxu_us_-_diendan.article_catego' at line 3


My Full Database infor


Database nhactinhvienxu_us_-_diendan - Table article running on localhost

King Kovifor
06-29-2005, 09:32 PM
cinq, what would we do if the global php section isn't there?

Mythotical
07-02-2005, 05:02 AM
Ok these edits I'm posting are if you us vbadvanced portal 2.0 then follow these steps:
In your vba_cmps_include_template.php find:
$specialtemplates = array_merge($specialtemplates,
array(
'adv_modules',
'adv_portal_opts',
'adv_portal_page',
'attachmentcache',
'bbcodecache',
'birthdaycache',
'eventcache',
'iconcache',
'maxloggedin',
'rankphp',
'smiliecache',
'userstats',
)
);

Replace with:
$specialtemplates = array_merge($specialtemplates,
array(
'adv_modules',
'adv_portal_opts',
'adv_portal_page',
'attachmentcache',
'bbcodecache',
'birthdaycache',
'eventcache',
'iconcache',
'maxloggedin',
'rankphp',
'smiliecache',
'userstats',
'vbart_options'
)
);


In your vba_cmps_include_top.php find:
$cmps_options = unserialize($datastore['adv_portal_opts']);

Add Above:
$vbart_options = unserialize($datastore['vbart_options']);
unset($datastore['vbart_options']);

Enjoy and glad I could help.

michaelsilvia
08-09-2005, 07:37 AM
Did everthing, but it is not showing up.

In my ACP, the modules are showing in the CMPS hack, BUT the module does not show up:

http://forums.usfkclassifieds.com/

What do you mean by this:

5. Don't forget to update your index pages(s) to show the new module.

Mike

DonLKSAB
08-31-2005, 01:37 PM
Same here cant get it to show up.

Anyone managed to get the module to show up in RC2?

/DonLKSAB

DonLKSAB
09-17-2005, 06:20 PM
Noone managed to get it to show up?

/DonLKSAB

wim20178
10-09-2005, 08:06 PM
my mistake ... shouldnt have posted :o

Sean S
01-05-2006, 01:55 AM
my mistake ... shouldnt have posted :o

I just installed this one today for my site and I also couldn't get the thumbnails to show up, so here is a little fix that I made for the thumbnails to show, it worked for me so hopefully it will work for you.

first, for the new version of vba, follow the updated instructions at post 42, https://vborg.vbsupport.ru/showpost.php?p=729358&postcount=42

after that, replace lines 20 to 22 in cmps_articles.php with the following,

$articon=$featuredbits['icon'];
$articonimg = '<a href="' . $vboptions[bburl] . '/articles.php?action=viewarticle&artid=' . $articleid . '"><img title="' . $title . '" src="' . $articon . '" border=1></a>';

that should fix the problem with the images not showing up.