Page 1 of 1

Book on Multiple pages in site :?:

Posted: Sun Aug 09, 2009 9:01 pm
by Wulfgen
Script URL: GBook 1.6
Version of script: 1.6
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: multiple, multiple pages, multiple entries

Write your message below:

How would it be possible to have multiple guestbooks? I have a client with over 27+ product and they want to have a gbook system for each product

Is that possible and that also would mean that each product would have its own entries.txt file - right?

:?:

Posted: Mon Aug 10, 2009 8:58 am
by Klemen
The simplest way would be to install several GBooks, each on it's own folder. For example:
www.domain.com/product1/gbook.php
www.domain.com/product2/gbook.php
www.domain.com/product3/gbook.php
...

A better solution would be to modify the GBook code to accept a new parameter, say "gbook.php?product=product1" which would tell it which entries file to use (product1.txt). This requires PHP knowledge though and it out of the scope of my support here.

Posted: Mon Aug 10, 2009 6:46 pm
by DC
Took a quick look you should be able to do somthing like this in the GB code. so then it swaps to the file you need for each section that is called.

That way you can then just add a param as Klem said.
This is just my quick example ...

You would prob be best writing it into a func and then use it where you need.

in your url mysite.com/gbook.php?prod=1

In the GB code.

if (isset($_GET['prod'])) $swap = trim(strip_tags($_GET['prod']));
if(file_exists("$swap.txt")){
if ($swap == '1'){
$lines=file("$swap.txt");
}elseif ($swap == '2'){
$lines=file("$swap.txt");
}elseif ($swap == '3'){
$lines=file("$swap.txt");
}else{
$lines=file("default.txt");
}
}

Again just a quick example might get you started but sounds like a lot if you have 27+ my example only shows 3 :-)

DC