Jump to content


Photo
- - - - -

Testimonials script


  • Please log in to reply
8 replies to this topic

#1 cyberpedz

cyberpedz

    Advanced Member

  • Members
  • PipPipPip
  • 268 posts
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 19 November 2007 - 10:39 PM

Hi guys i am looking for a free testimonials script to add to my site i have searched in google but the few i have tried do not seem to be great.

I want one that is lightweight and simple just wondered if any of you knew of any.


#2 BabyBen

BabyBen

    </cheeky>

  • Privileged
  • PipPipPipPip
  • 564 posts
  • Location:Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 20 November 2007 - 12:06 AM

What do you want it to do?


#3 cyberpedz

cyberpedz

    Advanced Member

  • Members
  • PipPipPip
  • 268 posts
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 20 November 2007 - 07:24 AM

I would like people to be able to add testimonials to my site they fill in form i then authorize it and would also like it to randomize which ones it shows on sight


#4 BabyBen

BabyBen

    </cheeky>

  • Privileged
  • PipPipPipPip
  • 564 posts
  • Location:Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 20 November 2007 - 12:02 PM

For the random aspect of the testimonials, here's a PHP script I use on a site at the moment. The txt file contains nothing more than the quotes with line breaks.

TXT file:
It was brilliant, thank you
I will be back again
Love your work, darling - we must do lunch
Your web designer is hot - is he single?

:D


PHP file:
<?php
$quotesfile = "file-includes/testimonials.txt";  //Relative path to and the filename of the file that contains your quotes. 
//You should not have to edit anything after this line.  


if ($array = @file("$quotesfile")) {  
// Build an array with the quotes
$quote = rand(0, count($array)-1);

$ar.= "<blockquote>\"";
//clen the array
$array[$quote] = stripslashes(htmlentities($array[$quote])); 
//choose a random quote from the array.  
$ar.= $array[$quote];
$ar.= "\"</blockquote>";
echo $ar;
}  
else{
   echo ("<blockquote>If the script doesn't work - you will see this message!</blockquote>");  
}
?>

:)


#5 cyberpedz

cyberpedz

    Advanced Member

  • Members
  • PipPipPip
  • 268 posts
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 21 November 2007 - 01:02 AM

Thanks i get this error using your code

PHP Notice: in file modules/module_webpages.php(74) : eval()'d code on line 9: Undefined variable: ar


#6 Thomas Thomassen

Thomas Thomassen

    HTTP 503

  • Privileged
  • PipPipPipPipPip
  • 2,254 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 21 November 2007 - 05:24 PM

That's because the $ar variable isn't initialized but the code implies it does.
Remove the period in that line.
$ar= "<blockquote>\"";
so it looks like this.


#7 cyberpedz

cyberpedz

    Advanced Member

  • Members
  • PipPipPip
  • 268 posts
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 15 February 2008 - 12:09 PM

Ok so not been here for a while and gave up trying to use this but i am back again giving it a go so i have put this code in

[codebox]<?php
$quotesfile = "file-includes/testimonials.txt"; //Relative path to and the filename of the file that contains your quotes.
//You should not have to edit anything after this line.


if ($array = @file("$quotesfile")) {
// Build an array with the quotes
$quote = rand(0, count($array)-1);

$ar.= "<blockquote>\"";
//clen the array
$array[$quote] = stripslashes(htmlentities($array[$quote]));
//choose a random quote from the array.
$ar.= $array[$quote];
$ar.= "<blockquote>\"";
echo $ar;
}
else{
echo ("<blockquote>If the script doesn't work - you will see this message!</blockquote>");
}
?>[/codebox]

But get the message "If the script doesn't work - you will see this message!"

Any ideas?


#8 Rachael

Rachael

    Princess.

  • Privileged
  • PipPipPipPipPip
  • 1,390 posts
  • Location:Northants, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 15 February 2008 - 01:02 PM

Are you using it in a page with a .php extension?


#9 kingy da killa

kingy da killa

    Free man on the land

  • Privileged
  • PipPipPipPipPip
  • 2,144 posts
  • Gender:Male
  • Location:London SW
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 29 November 2010 - 12:55 PM

'cutenews' search that, easily intregratable (my spellings not great..) and works perfect.

benn - www.bkwebdesignandhosting.co.uk





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users