Events Made Easy › Forums › How do I … › Can't use comments & GD star rating, shows same comment & rating for all events
Tagged: comments, Event Page, rating
- This topic has 13 replies, 6 voices, and was last updated 12 years, 6 months ago by Franky.
-
AuthorPosts
-
Sun 7 Nov 2010 at 21:16 #42218Sun 7 Nov 2010 at 22:12 #45307FrankyKeymaster
Nope, not yet. Since we use one page to essentialy do all the event stuff, wordpress mixes all comments together as well. I’m playing around with some wordpress filters but not really successful so far. I think I can modify the code for “Five Star Rating” to work with event ID’s instead of Post ID’s, but that needs work of course …
Thu 10 Feb 2011 at 10:27 #45308AnonymousInactiveHi Franky,
Do you have any news about comments and rating on a per event basis?
If you could implement that as a standard, I would like to support your work.
Cheers, Sven
Thu 10 Feb 2011 at 18:42 #45309FrankyKeymastersorry, not yet …
Tue 12 Jul 2011 at 12:42 #45310AnonymousInactiveHi franky,
do you have any news ?
I need to have comments in event_single page, but i don’t know how to do that…Is anyone can help ? doesn’t matters is there isn’t Five Star Rating… just need to have comments.
Thanks !!!!
Tue 12 Jul 2011 at 12:57 #45311AnonymousInactiveI recently disabled wordpress comments and started using facebook comments instead which was a lot easier to implement.
I inserted the facebook code into the settings for the single event page as follows:
<h2>Comments</h2>
<div id=”fb-root”></div><script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script><fb:comments href=”#_EVENTPAGEURL” num_posts=”5″ width=”590″></fb:comments>
This might be of use to some people
Fri 15 Jul 2011 at 16:12 #45312AnonymousInactiveGreat !!! very good idea…thanks you so much !
Wed 20 Jul 2011 at 21:24 #45313AnonymousInactiveBoleo,
I edited the em_event.php file in the ‘classes’ folder to get the RATINGS running. Here’s what I did ( a bit sloppy I admit, but it works on xampp )
41. 'event_date_modified' => array( 'name'=>'date_modified', 'type'=>'%s' ),
42. 'blog_id' => array( 'name'=>'blog_id', 'type'=>'%d' ),
43. 'group_id' => array( 'name'=>'group_id', 'type'=>'%d' )
44. );First add a variable called ‘ratings’ below line 43. I should look like this:
‘ratings’ => array( ‘name’=>’ratings’, ‘type’=>’%d’ ). Make sure to add a ‘,’ after line 43 as well.
next, go to line 71 ,and add ‘var ratings;’ (minus the quotes).
70.var $group_id;
71.
72. var $image_url = '';
73. /**Then go down to line 236, and below it, add ‘$this->ratings = ( !empty($_POST) ) ? $_POST : ”;’ ( again minus the quotes on the ends)
235. $this->end_date = ( !empty($_POST['event_end_date']) ) ? $_POST['event_end_date'] : $this->start_date;
236. $this->rsvp = ( !empty($_POST['event_rsvp']) ) ? 1:0;
237. //$this->spaces = ( !empty($_POST['event_spaces']) && is_numeric($_POST['event_spaces']) ) ? $_POST['event_spaces']:0;
ADD CODE HERENow create the database fields to interact with your ratings system in ‘wp_em_events’, and go to line 709. Below this line you will need to define your code for the ratings system ( I’ll call it $test for this example ) and…
call = '#_RATINGS';
$eventid = $this->id
$ratings = <-SOME CODE->;
$replace = $ratings;
break;I post the ratings that users enter to a seperate php file, and pass the $event id along in a hidden form field ‘<input name=”eventid” type=”hidden” value=”$eventid” />’
I have the form defined as follows, ABOVE line 703. It’s setup like this
$rateform =
<<< END
<strong>Rate This Location</strong>
<form action="http://localhost/test/ratepost.php" method="post">
<select name="votes">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input type="hidden" value="$this->id" name="eventid"/>
<input type="hidden" value="total +1" name="total"/>
<input value="submit" name="submit" type="submit" style="background: #333;"/>
</form>
END;*** Make sure that <<< END and END; appear on their own line with no white space ***
On the external page ( that it’s posting to) define your $_POST variables ( we’ll say
$vote=$_POST , $event_id = $_POST, etc.
Now you just take the variables and do a mysql update for the ratings field WHERE event_id = $event_id …
Then to prevent users who are not logged in just encase the whole thing in an IF statement:
if (is_user_logged_in)
{
case: ‘#_RATINGS’
< YADDA YADDA YADDA >
replace=$ratings;
break;
}
else $replace='<p>You must login to rate events</p>’;
Like I said a bit sloppy, and a bit long-winded in the explanation, but if you get the idea I’m sure you can do something with it. Hell, you’ll probably find a quicker easier way than I did.
Wed 20 Jul 2011 at 21:29 #45314AnonymousInactiveSorry, forgot to add that you will need to repeat the process to create code that displays your ratings ( something like #_DISPLAYRATINGS ) the smae way as you created #_RATINGS, and add the placeholders to your single events page in the EM settings.
Wed 20 Jul 2011 at 21:42 #45315AnonymousInactiveIf anyone has any idea how to get comments on the single events page that would be great, because I’m stumped. I saw that Marcus had mentioned that you can use the em_content like the WP the_content, however when I add that and <?php comments_template(); ?> below it on the events_single.php page in templates, I get comments on every page. I know this is because EM doesn’t treat events as posts, but does anyone have a quick way to make this work?
Thu 21 Jul 2011 at 07:08 #45316FrankyKeymasterwrong forum, you need the “events manager” forum, this is “Events Manager Extended”
Sun 20 May 2012 at 17:17 #45317AnonymousInactiveHi,
I’m interested also to know how I can show comments on every event. I don’t want to disable my old wordpress comments and I this code does’nt do anything:
<h2>Comments</h2>
<div id=”fb-root”></div><script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script><fb:comments href=”#_EVENTPAGEURL” num_posts=”5″ width=”590″></fb:comments>
Any idea to put comments on the events?? Thanks so much
Thu 24 May 2012 at 13:28 #45318AnonymousInactiveHi,
I need an answer to go on with the project. Please help me.
– Is there some way to show comments on every event without removing the comments that I have already?
Thanks!
Thu 24 May 2012 at 22:33 #45319FrankyKeymasterRead this thread: http://www.e-dynamics.be/bbpress/topic.php?id=48#post-3233
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.