Lastest guestbooks posts in home page
9 years 10 months ago #13901
by Pete
DigiOz Webmaster
www.digioz.com
Replied by Pete on topic Lastest guestbooks posts in home page
Donations are always welcome and appreciated, but you don't have to feel obligated to pay as this is an Open Source Project. Still, if you do want to do that send it to digioz@gmail.com.
I actually already started working on it and have the basic skeleton done. I will try to finish up soon.
Pete
I actually already started working on it and have the basic skeleton done. I will try to finish up soon.
Pete
DigiOz Webmaster
www.digioz.com
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #13902
by Tomiix
Replied by Tomiix on topic Lastest guestbooks posts in home page
Okay i will donate when that is done. Nice to hear that project is a working in progress.
Last edit: 9 years 10 months ago by Tomiix.
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #13903
by Pete
DigiOz Webmaster
www.digioz.com
Replied by Pete on topic Lastest guestbooks posts in home page
Here is the first version of the code:
All you have to do is to change the following lines at the top:
You can add additional guestbook instances to the list, and it will list them all one by one. Here the assumption is that the list.php file that is running is one directory level above all guestbook instances.
Give it a try and let me know what you think. I didn't do a whole lot of testing with it, so I am hoping you can test it for me.
Pete
Code:
<?php
/**
* Created by DigiOz Multimedia.
* User: Pete Soheil
* Date: 11/13/14
* Time: 9:15 AM
*/
// Declare configuration variables
$gbInstances = array();
$gbInstances[] = 'guestbook1';
$gbInstances[] = 'guestbook2';
// Body of the code do not modify
$configPath = $gbInstances[0]."/config.php";
include($configPath);
$langPath = $gbInstances[0]."/language/".$default_language;
include($langPath);
include($gbInstances[0]."/gbclass.php");
foreach($gbInstances as $gbInstance)
{
// Read Entries
$filename = $gbInstance . "/data/list.txt";
//echo $filename."<br>";
$handle = fopen($filename, "r");
if (filesize($filename) == 0)
{
// print "There are currently no entries to display";
}
else
{
// Read Data from GB instance
$datain = fread($handle, filesize($filename));
fclose($handle);
//echo $datain;
$out = explode("<!-- E -->", $datain);
// Loop through the array
for ($i=0; $i<5; $i++)
{
$lines[$i] = unserialize($out[$i]);
}
$linesDisplayed = 0;
$linesCount = count($lines);
if ($linesCount > 5)
{
$linesCount = 5;
}
// Display the entry
for ($j=0; $j<$linesCount; $j++)
{
//echo $i."<br>end-".$end."-start-".$start;
echo "<table bgcolor=#EFEFEF bordercolor=#C0C0C0 border=1 width=500 cellspacing=0 cellpadding=10><tr><td background=\"images/toolbar.jpg\" height=\"20\"></td></tr><tr><td>";
echo "<b>$listDatetxt: </b>";
$lines[$j]->showDate();
echo "<br><b>$listnametxt: </b>";
$lines[$j]->showFrom();
echo "<br><b>$listemailtxt: </b><a href=\"mailto:";
$lines[$j]->showEmail();
echo "\">";
$lines[$j]->showEmail();
echo "</a><br><br><b>$listMessagetxt: </b>";
$lines[$j]->showMessage();
echo "</td></tr></table><br>";
}
}
}
?>
All you have to do is to change the following lines at the top:
Code:
$gbInstances[] = 'guestbook1';
$gbInstances[] = 'guestbook2';
You can add additional guestbook instances to the list, and it will list them all one by one. Here the assumption is that the list.php file that is running is one directory level above all guestbook instances.
Give it a try and let me know what you think. I didn't do a whole lot of testing with it, so I am hoping you can test it for me.
Pete
DigiOz Webmaster
www.digioz.com
Last edit: 9 years 10 months ago by Pete.
The following user(s) said Thank You: Tomiix
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #13904
by Tomiix
Replied by Tomiix on topic Lastest guestbooks posts in home page
Finally my network works fine, that is reason why i answer now. So i tested this code first orginal guestbook (nothing changed, everything is orginal than 1.7.3 guestbook is), but make error the end..... "Call to a member function showDate() on a non-object in /home/somester/public_html/1/test.php on line 72". Error make () marks.
Last edit: 9 years 10 months ago by Tomiix.
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #13905
by Pete
DigiOz Webmaster
www.digioz.com
Replied by Pete on topic Lastest guestbooks posts in home page
Your test.php file should be at "/home/somester/public_html/test.php", not inside the "1" folder, so move it up a folder level.
Pete
Pete
DigiOz Webmaster
www.digioz.com
Last edit: 9 years 10 months ago by Pete.
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #13907
by Tomiix
Replied by Tomiix on topic Lastest guestbooks posts in home page
Yes i tested that and I got same problem.
Last edit: 9 years 10 months ago by Tomiix.
Please Log in or Create an account to join the conversation.
Time to create page: 0.130 seconds