View Full Version : a sticy post in CMPS
Hi
I made one post sticky in CMPS news forum, so it will show always as news # 1, but when I added posts to the forum, it bushed the sticky post down in the cmps page.
How can I keep that post always the first?
and BTW, what is the difference between CMPS and Frontpages hacks?
Thanx
Hani
Brian
08-03-2004, 09:07 AM
To have your sticky threads displayed first, open your forum/modules/news.php file and look for:
ORDER BY " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC
Replace that with:
ORDER BY sticky DESC, thread.dateline DESC
As for the differences - http://vbadvanced.com/forum/search.php - CMPS homepage differences ;)
pdatotaal
08-05-2004, 12:55 AM
Was looking voor de same! thanks, but if looks that is must be a option that you put on/off?
Diver
11-16-2004, 10:07 AM
thank you so much, i was looking for this :)
dleblanc
12-19-2004, 03:41 PM
To have your sticky threads displayed first, open your forum/modules/news.php file and look for:
" . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . "
Replace that with:
sticky DESC,
As for the differences - http://vbadvanced.com/forum/search.php - CMPS homepage differences ;)
I look this up and it has " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " already in the news.php. So what needs to be replace where to keep the sticky on the top of the Center Block on the CMPS.
Brian
12-19-2004, 03:42 PM
The code that I posted above.
dleblanc
12-19-2004, 07:47 PM
Brian
I'm not sure I am understanding you correctly because I am still new at this. Below is what I done and it seems to work, is this correct.
orginal infomation:
" . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC"
Change to:
" . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " sticky DESC"
Brian
12-20-2004, 10:39 AM
No... Look for the first bit of code mentioned in that post and then just replace it with sticky DESC.
dleblanc
12-20-2004, 03:20 PM
Sorry, I'm a little slow but I thinks I finally understood. This is what I done I replaced:
ORDER BY " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC" . iif($vboptions['shownewsattach'], ', attachmentid') . "
ORDER BY sticky DESC, postdateline DESC" . iif($vboptions['shownewsattach'], ', attachmentid') . "
Sometimes we need a little more help, but I really do appreicated the time you give us...I for one would be lost. Each time I come across one more bridge to figure out I am getting better.
tormodg
12-21-2004, 05:57 PM
Hm...no offense, but a statement like "replace bla bla bla with bla bla bla" is really straightforward...
dleblanc
12-21-2004, 08:07 PM
No offense taken, some of us old geezers are slow when it comes to the new technology. Remember the old were mostly self taught in computer language, thrown to the wolfs sort of speaking when it came to computers. My 27 year career has been an EMT-Paramedic and I’m sure some of my medical teaching is straight forward and would sound Greek…unless you are Greek…no offense.
:rolleyes: With all that bla bla bla it works…I know, I know straightforward…I’m learning. (ha)
Thanks all
oldengine
03-09-2005, 11:11 PM
Hm...no offense, but a statement like "replace bla bla bla with bla bla bla" is really straightforward...
I don't think it's clear at all. Especially when it has a gob of punctuation around it and it produces a database error.
// mod for sticky news
// ORDER BY " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC
ORDER BY sticky DESC, postdateline DESC
// end mod
So, I must have missed something?
Database error in vBulletin 3.0.7:
Invalid SQL:
SELECT IF(votenum >= 5, votenum, 0) AS votenum, IF(votenum >= 5 AND votenum != 0, votetotal / votenum, 0) AS voteavg,
thread.threadid, thread.title, replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=replycount, replycount+1, views) AS views, forumid, post.postid, pagetext, allowsmilie
,thread.iconid AS threadiconid, iconpath AS threadiconpath
, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM thread AS thread
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN icon USING (iconid)
Brian
03-10-2005, 09:37 AM
I just modified the original post to include the whole line, so that should help to prevent someone from looking for/changing the code incorrectly.
oldengine
03-10-2005, 11:56 AM
Why is my script have "postdateline" instead of "thread.dateline" - does it matter?
Brian
03-10-2005, 02:02 PM
I think I accidentally copied that from a different file that I was working on. Just leave thread.dateline in there as that should work better anyways.
oldengine
03-10-2005, 03:23 PM
I'm sorry for the confusion on this modification.
I like to place comments where I modify files, but in this case, those //comments were interfering with the script and thus caused the sql database error.
All sorted out and working now.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.