RevCMS article comments

Brackston

Member
Aug 6, 2014
232
20
Okay, 2 things to ask.
1. Does anyone have a code for like/dislike buttons on news comments? So you can like/dislike a users post. I want it to be like fresh hotels, cant supply a screenie atm because fresh is down, Ill update thread when its back up.

2. An edit button for comments. So you can only edit your own comments, but rank 5 + can edit any. and once you edit your comment, up the top of it itll say "Edited on blahblahblah".

Thanks :)
 
Oh and can someone give me the code so when you go to examplehotel.come/news it redirects to the latest news article.
 

LewisBHS

New Member
Dec 28, 2014
13
1
1) This has not been released and you will have to code this yourself.
2) This is quite simple to do in PHP just requires a little bit of javascript(if you want to do it properly) - you will have to do it yourself I don't think someone will do it for you.
3) Here you go.
Code:
        $url = str_replace('/', '', $_SERVER['REQUEST_URI']);
        $news = mysql_query("SELECT id FROM cms_news ORDER BY id DESC LIMIT 1");
        $news = mysql_fetch_assoc($news);
        if($url == 'news'){
            header('Location: ' . $_CONFIG['hotel']['url'] . '/index.php?url=news&id=' . $news['id']);
        }
You can either put it in the core like me or at the top of the file.
 

Brackston

Member
Aug 6, 2014
232
20
Thanks man, where would that be placed in class.core, or articles?
 
Oh, I see the problem. I just had to add <?php and ?> at the top and end of it. Thanks man! :)
 

Khalil

IDK
Dec 6, 2011
1,642
786
Okay, 2 things to ask.
1. Does anyone have a code for like/dislike buttons on news comments? So you can like/dislike a users post. I want it to be like fresh hotels, cant supply a screenie atm because fresh is down, Ill update thread when its back up.

2. An edit button for comments. So you can only edit your own comments, but rank 5 + can edit any. and once you edit your comment, up the top of it itll say "Edited on blahblahblah".

Thanks :)
Wrong section, this should be in the support section not in the releases section.


1) This has not been released and you will have to code this yourself.
2) This is quite simple to do in PHP just requires a little bit of javascript(if you want to do it properly) - you will have to do it yourself I don't think someone will do it for you.
3) Here you go.
Code:
        $url = str_replace('/', '', $_SERVER['REQUEST_URI']);
        $news = mysql_query("SELECT id FROM cms_news ORDER BY id DESC LIMIT 1");
        $news = mysql_fetch_assoc($news);
        if($url == 'news'){
            header('Location: ' . $_CONFIG['hotel']['url'] . '/index.php?url=news&id=' . $news['id']);
        }
You can either put it in the core like me or at the top of the file.
Or he could simply just not use news comments. And why are you redirecting without killing the page?
 

Users who are viewing this thread

Top