need help with more review stuff plz.

Various mods to change or add features.

need help with more review stuff plz.

Postby psyblast » 2004-07-28 01:39 pm

ok what I wanna do now is make it so I can place <#review_author>, <#review_date>, <#review_id>, and <#review> wherever I want them to go on the stats page instaed of just having them in one certain spot with the <#reviews> tag.

I tried some things with the stats.php file but it wouldnt allow the new tags to show up.
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby psyblast » 2004-07-28 02:01 pm

nevermind I figured it out, all I had to do was do what I did before, but remove the .'s :)

you can delete this thread if you want jeremy, or you can keep it up, and I'll post the code on how to do it for people to use if they want it.
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby psyblast » 2004-07-28 04:25 pm

ok I need some help again Jeremy, instead of the reviews being printed out onto new lines, they are going into the same spots, so now the dates are like this "July 26, 2004July 28, 2004" how can I solve this problem?

you can see what I mean by going here http://www.pokemontop500.com/index.php?a=stats&id=6
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-28 05:30 pm

put stats.html back how it was originally, with just <#reviews>. then create a new file in your skin directory named review.html. put in there the stuff that you had put in stats.html... u know, the code to display one review. then make a loop in stats.php that runs each review through review.html and adds the output to $TMPL['reviews'].

if you need help with the coding post again.
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Postby psyblast » 2004-07-28 05:40 pm

whats the code I will need to add to stats.php?

this is what the coding in my stats.php looks like

Code: Select all
$query = "SELECT review_id, author, review_date, review FROM ".$CONFIG['sql_prefix']."_reviews WHERE id3 = ".$FORM['id'];
if ($FORM['allreviews']) { $result = $db->Execute($query); }
else { $result = $db->SelectLimit($query, 10, 0); }
while (list($review_id, $author, $review_date, $review) = $db->FetchArray($result)) {
$review_date = strtotime($review_date);
$review_date = date('F j, Y', $review_date);
  $TMPL['review_author'] .= "$author";
  $TMPL['review_date'] .= "$review_date";
  $TMPL['review_id'] .= "$review_id";
  $TMPL['review'] .= "$review";
}
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-28 06:36 pm

right before the }, put this:
Code: Select all
$TMPL['reviews'] .= do_template("review");
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Postby psyblast » 2004-07-28 07:23 pm

I'm still getting the duplicate information on the 2nd review.

http://www.pokemontop500.com/index.php?a=stats&id=6

I'd also like to try to get it to look like the following Image[/img]
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-28 08:17 pm

use this, get rid of some .='s:
Code: Select all
  $TMPL['review_author'] = "$author";
  $TMPL['review_date'] = "$review_date";
  $TMPL['review_id'] = "$review_id";
  $TMPL['review'] = "$review";

that should do it.

if you want it like you have it in the image, just add some code before and after the while loop and have review.html be just the body of the table. sort of like how tableheader.html, table.html, and tablefooter.html interact.
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Postby psyblast » 2004-07-28 08:19 pm

that code worked Jeremy, you da man :)

so I'll have to make some more files for it to be how I want it to be pretty much right? like reviewhead.html, review.html, and reviewfoot.html?
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby psyblast » 2004-07-28 09:15 pm

ok this isint workin, i've tried every single possible way to get it to work and it just isint workin >_<
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-28 10:31 pm

what code are you using?
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Postby psyblast » 2004-07-29 07:31 pm

heres the code I have setup in stats.php

Code: Select all
$query = "SELECT review_id, author, review_date, review FROM ".$CONFIG['sql_prefix']."_reviews WHERE id3 = ".$FORM['id'];
if ($FORM['allreviews']) { $result = $db->Execute($query); }
else { $result = $db->SelectLimit($query, 10, 0); }
while (list($review_id, $author, $review_date, $review) = $db->FetchArray($result)) {
$review_date = strtotime($review_date);
$review_date = date('F j, Y', $review_date);
  $TMPL['review_author'] = "$author";
  $TMPL['review_date'] = "$review_date";
  $TMPL['review_id'] = "$review_id";
  $TMPL['review'] = "$review";
  $TMPL['reviews'] .= do_template("reviewheader");
  $TMPL['reviews'] .= do_template("review");
  $TMPL['reviews'] .= do_template("reviewcloser");
}


also theres a little thing thats buggin me about this, when a site doesnr have a review, NOTHING shows up where the reviews should go, I'd like to have alteast a box down there that says "rate and review this site"
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-29 07:57 pm

try this:
Code: Select all
$TMPL['reviews'] .= do_template("reviewheader");
$query = "SELECT review_id, author, review_date, review FROM ".$CONFIG['sql_prefix']."_reviews WHERE id3 = ".$FORM['id'];
if ($FORM['allreviews']) { $result = $db->Execute($query); }
else { $result = $db->SelectLimit($query, 10, 0); }
while (list($review_id, $author, $review_date, $review) = $db->FetchArray($result)) {
$review_date = strtotime($review_date);
$review_date = date('F j, Y', $review_date);
  $TMPL['review_author'] = "$author";
  $TMPL['review_date'] = "$review_date";
  $TMPL['review_id'] = "$review_id";
  $TMPL['review'] = "$review";
  $TMPL['reviews'] .= do_template("review");
}
$TMPL['reviews'] .= do_template("reviewcloser");
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Postby psyblast » 2004-07-29 08:42 pm

alright got the author, date, and ID, and review to show up right, but now I ned to know how to prevent the header, and footer to keep from looping.

I had to change the php coding a little bit to this Jeremy

Code: Select all
$query = "SELECT review_id, author, review_date, review FROM ".$CONFIG['sql_prefix']."_reviews WHERE id3 = ".$FORM['id'];
if ($FORM['allreviews']) { $result = $db->Execute($query); }
else { $result = $db->SelectLimit($query, 10, 0); }
while (list($review_id, $author, $review_date, $review) = $db->FetchArray($result)) {
$review_date = strtotime($review_date);
$review_date = date('F j, Y', $review_date);
  $TMPL['review_author'] = "$author";
  $TMPL['review_date'] = "$review_date";
  $TMPL['review_id'] = "$review_id";
  $TMPL['review'] = "$review";
  $TMPL['reviews'] .= do_template("reviewheader");
  $TMPL['reviews'] .= do_template("review");
}
  $TMPL['reviews'] .= do_template("reviewcloser");
psyblast
Advanced Member
 
Posts: 64
Joined: 2004-02-23 12:16 am

Postby Jeremy » 2004-07-29 09:30 pm

did you try what i put in my last post? what was wrong with that?
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Next

Return to Mods

Who is online

Users browsing this forum: No registered users and 1 guest

cron