Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 23, 2012, 07:25:14 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155439
Posts in
21702
Topics by
7732
Members
Latest Member:
Smacki
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
LAtest entry to guestbok
Pages: [
1
]
Go Down
Author
Topic: LAtest entry to guestbok (Read 3501 times)
jar
Offline
Posts: 62
LAtest entry to guestbok
«
on:
August 22, 2008, 02:13:45 PM »
i need a snnipet to show me LAtest entry to guestbok . something like the latest comments
someone? can help me ?
please
Logged
ruebenwurzel
WebsiteBaker Org e.V.
Offline
Posts: 7972
Re: LAtest entry to guestbok
«
Reply #1 on:
August 23, 2008, 09:42:30 AM »
Hello,
try it with the anynews snippet and replace the database query to query the guestbook.
Matthias
Logged
jar
Offline
Posts: 62
Re: LAtest entry to guestbok
«
Reply #2 on:
August 25, 2008, 01:41:28 PM »
Quote from: ruebenwurzel on August 23, 2008, 09:42:30 AM
Hello,
try it with the anynews snippet and replace the database query to query the guestbook.
Matthias
i dont know how !!
it`s need to replace just the name of the tabel ?
hmm !!
and i want to show just like the latest coments not like anynews .. i try to modify the latest coments snipet and don`t work
hmmm .. can you help please ..
«
Last Edit: August 25, 2008, 01:45:14 PM by jar
»
Logged
macsmet
Offline
Posts: 233
Re: LAtest entry to guestbok
«
Reply #3 on:
August 25, 2008, 04:06:46 PM »
Hi Jar,
This one has been made before in 2007.
I searched the forum, downloaded it and attached it to this message.
MacSmet
Logged
jar
Offline
Posts: 62
Re: LAtest entry to guestbok
«
Reply #4 on:
August 25, 2008, 05:28:44 PM »
Quote from: macsmet on August 25, 2008, 04:06:46 PM
Hi Jar,
This one has been made before in 2007.
I searched the forum, downloaded it and attached it to this message.
MacSmet
where you find the snipet because i have a problem
the |show more link | does`n go on the page where is posted
Logged
doc
Guest
Re: LAtest entry to guestbok
«
Reply #5 on:
August 26, 2008, 06:24:21 AM »
Hello,
I sent this code snippet some time ago to Escpro who asked for a feature to extract the latest entry from the guestbook. Maybe it helps. The code needs to be added to the index.php of your template where you want to display the guestbook entry.
Code:
<?php
// fetch last entry from guestbook table (order by timestamp)
$result
=
$database
->
query
(
"SELECT * FROM `"
.
TABLE_PREFIX
.
"mod_guestbook` WHERE `approved`='1' ORDER BY `posted_when` DESC LIMIT 1"
);
// display last entry or a default message
if(
$result
&&
$result
->
numRows
() >
0
) {
$data
=
$result
->
fetchRow
();
// output header with author and time (month-day-year)
echo
'<strong>'
.
$wb
->
strip_slashes
(
$data
[
'name'
]) .
' - '
.
date
(
'm-d-y'
,
$wb
->
strip_slashes
(
$data
[
'posted_when'
])) .
'</strong><br />'
;
// output guestbook message
echo
$wb
->
strip_slashes
(
$data
[
'message'
]);
} else {
// no guestbook data found
echo
'No guestbook entry available.'
;
}
?>
Regards Christian
P.S.: If you are only interested in the last entry one may want to use the WB database function get_one instead (/framework/class.db.php).
«
Last Edit: August 26, 2008, 06:26:15 AM by doc
»
Logged
jar
Offline
Posts: 62
Re: LAtest entry to guestbok
«
Reply #6 on:
August 26, 2008, 09:11:51 PM »
Quote from: doc on August 26, 2008, 06:24:21 AM
Hello,
I sent this code snippet some time ago to Escpro who asked for a feature to extract the latest entry from the guestbook. Maybe it helps. The code needs to be added to the index.php of your template where you want to display the guestbook entry.
Code:
<?php
// fetch last entry from guestbook table (order by timestamp)
$result
=
$database
->
query
(
"SELECT * FROM `"
.
TABLE_PREFIX
.
"mod_guestbook` WHERE `approved`='1' ORDER BY `posted_when` DESC LIMIT 1"
);
// display last entry or a default message
if(
$result
&&
$result
->
numRows
() >
0
) {
$data
=
$result
->
fetchRow
();
// output header with author and time (month-day-year)
echo
'<strong>'
.
$wb
->
strip_slashes
(
$data
[
'name'
]) .
' - '
.
date
(
'm-d-y'
,
$wb
->
strip_slashes
(
$data
[
'posted_when'
])) .
'</strong><br />'
;
// output guestbook message
echo
$wb
->
strip_slashes
(
$data
[
'message'
]);
} else {
// no guestbook data found
echo
'No guestbook entry available.'
;
}
?>
Regards Christian
P.S.: If you are only interested in the last entry one may want to use the WB database function get_one instead (/framework/class.db.php).
its ok but i want to have a link to the page where is posted
and i want to have more than one comment
thanks!!
Logged
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #7 on:
September 18, 2008, 01:50:55 PM »
Hi @all
jar is absolutely right.
The zip posted by macsmet doesn't work right with the links.
Is there someone to modify this and make it work?
Thanks in advance.
erpe
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
Bramus
Forum Team
Offline
Posts: 601
Re: LAtest entry to guestbok
«
Reply #8 on:
September 18, 2008, 03:20:53 PM »
i think if you change LIMIT 1 to some other value u will get more, havent tested because still at school in a college room but think that will work.
Logged
BRAMUS Internet Services
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #9 on:
September 18, 2008, 03:23:21 PM »
That is right, I tested it.
But the problem is the wrong link.
rgds
erpe
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
Bramus
Forum Team
Offline
Posts: 601
Re: LAtest entry to guestbok
«
Reply #10 on:
September 18, 2008, 05:55:01 PM »
what do you mean by wrong link? do you have an example or something? Havent been following this thread pretty good, but will try to help
Logged
BRAMUS Internet Services
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #11 on:
September 18, 2008, 06:12:14 PM »
Hi Bramus
thanks for helping.
Here is a link: http://www.rvb.bplaced.net/pages/last-gb-entry.php
Page bases on modul from macsmet some posts above.
Links are not pointing to the guestbook but to the start page, for pageID=29 seems to be not right, but
the guestbook on this site is pageID=29.
So there must be something wrong in the module.
rgds
erpe
«
Last Edit: September 19, 2008, 09:22:14 AM by erpe
»
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #12 on:
September 20, 2008, 05:56:10 PM »
Hi Bramus,
any ideas?
rgds
erpe
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
jar
Offline
Posts: 62
Re: LAtest entry to guestbok
«
Reply #13 on:
September 22, 2008, 09:47:16 PM »
another example is on adress :
www.haiinoras.ro
Logged
Bramus
Forum Team
Offline
Posts: 601
Re: LAtest entry to guestbok
«
Reply #14 on:
September 23, 2008, 05:35:07 PM »
I'm very busy at this moment with some other projects, didnt have time to test, maybe i can test the module tomorrow cause i need to setup a test installation tomorrow anyway.
Logged
BRAMUS Internet Services
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #15 on:
September 23, 2008, 05:57:19 PM »
Thanks for helping us.
If you want, I create an account for my testpage.
Give me an info via pm.
Thanks
erpe
«
Last Edit: September 25, 2008, 12:02:53 PM by erpe
»
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
jar
Offline
Posts: 62
Re: LAtest entry to guestbok
«
Reply #16 on:
October 01, 2008, 01:04:42 PM »
nothing yet
?\
Logged
erpe
Offline
Posts: 2077
Re: LAtest entry to guestbok
«
Reply #17 on:
November 10, 2008, 12:03:10 PM »
Hi Bramus,
thank you for working on this snippet.
For it was not that easy to "repair" the links and for they are not really neccessary (create a link to the guestbook at the bottom or the top of this item) Bramus removed the links.
The reworked snippet can be downloaded at
latest guestbook entry
rgds
erpe
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
Bramus
Forum Team
Offline
Posts: 601
Re: LAtest entry to guestbok
«
Reply #18 on:
November 10, 2008, 01:03:50 PM »
nice to see the snippet is working, hope you can use it as it is now. If there needs to be any modification, let it know so i can see if i can fix it.
Bram
Logged
BRAMUS Internet Services
Frediwan
Offline
Posts: 89
Re: LAtest entry to guestbok
«
Reply #19 on:
May 12, 2009, 08:55:10 AM »
hi
the "read more" text/link does not appear by showing not the whole entry?
Code:
display_gb_items(368, 1, 300, 1, "The latest news", "read more", "uups, no news available",false);
and how can i use this as a droplet?
any help for me please
frediwan
«
Last Edit: May 12, 2009, 09:10:28 AM by Frediwan
»
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...