Latest forum posts block
error 232
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
You need to remove the / after board from your forum path (e.g. yourdomain.tld/board/ to yourdomain.tld/board)
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
IPB 3.1.3 - Latest Forum Posts doesn't work after upgrade.
<?php
if( !defined( "CONTENTTELLER" ) )
{
die( "Error" );
}
$ipb_latest = ( isset( $datastore[ 'ipb_latest' ] ) ) ? $datastore[ 'ipb_latest' ] : "" ;
if( !$ipb_latest )
{
global $uwrapper;
$ipb_latest = "";
$uwrapper -> bbconnect();
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id, title_seo FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE NOT(forum_id = '83') AND NOT (forum_id = '51') AND NOT (forum_id = '79') ORDER BY last_post DESC LIMIT 5" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum, $title_seo ) = $database -> dbrow( $results ) )
{
$length = 23;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$ipb_latest .= "<li><a href=\"" . $preferences['website_uwrapper_forumpath'] . "/topic/" . $threadid . "-" . $title_seo . "/page__view__getnewpost\">" . $title . "</a></li>";
}
}
$uwrapper -> bbclose();
$system -> datastoreput( "ipb_latest", $ipb_latest );
}
echo $ipb_latest;
?>
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
Thanks. This one works. Now I only need to fix this cookie issue with CT.
http://community.contentteller.com/f6/338_cookies_issue,4.html
http://community.contentteller.com/f6/338_cookies_issue,4.html
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
This should work:
$ipb_latest .= "<li><a href=\"" . $preferences['website_uwrapper_forumpath'] . "/topic/" . $threadid . "-" . $title_seo . "/page__view__getnewpost\">" . $title . "</a></li>";
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
It works but not goes to last post instead goes to first post in topic. Thanks.
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
The following modification should work for IPB 3.0.5:
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id, title_seo FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE NOT(forum_id = '83') AND NOT (forum_id = '51') AND NOT (forum_id = '79') ORDER BY last_post DESC LIMIT 5" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum, $title_seo ) = $database -> dbrow( $results ) )
{
$length = 23;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$ipb_latest .= "<li><a href=\"" . $preferences['website_uwrapper_forumpath'] . "/topic/" . $threadid . "-" . $title_seo . "\">" . $title . "</a></li>";
}
}
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
After upgrade to IPB 3.0.5 ipb latest doesn't work. Here is a code:
<?php
if( !defined( "CONTENTTELLER" ) )
{
die( "Error" );
}
$ipb_latest = ( isset( $datastore[ 'ipb_latest' ] ) ) ? $datastore[ 'ipb_latest' ] : "" ;
if( !$ipb_latest )
{
global $uwrapper;
$ipb_latest = "";
$uwrapper -> bbconnect();
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE NOT(forum_id = '83') AND NOT (forum_id = '51') AND NOT (forum_id = '79') ORDER BY last_post DESC LIMIT 5" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum ) = $database -> dbrow( $results ) )
{
$length = 23;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$ipb_latest .= "<li><a href=\"" . $preferences['website_uwrapper_forumpath'] . "/index.php?act=ST&f=" . $forum . "&t=" . $threadid . "\">" . $title . "</a></li>";
}
}
$uwrapper -> bbclose();
$system -> datastoreput( "ipb_latest", $ipb_latest );
}
echo $ipb_latest;
?>
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
for the one for phpbb, could it also display the time of the last post, and who made it, and also the post count?
This should work:
$results = $uwrapper -> bbquery( "SELECT topic_id, topic_title, forum_id, topic_last_post_time, topic_last_poster_name, topic_replies FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE topic_approved = '1' ORDER BY topic_last_post_time DESC LIMIT 10" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum, $topic_last_post_time, $topic_last_poster_name, $topic_replies ) = $database -> dbrow( $results ) )
{
$length = 22;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$pbb_latest .= "· <a href=\"" . $preferences['website_uwrapper_forumpath'] . "/viewtopic.php?f=" . $forum . "&t=" . $threadid . "\">" . htmlspecialchars( $title ) . "</a> (" . htmlspecialchars( $topic_replies ) ." replies)<br />Posted by " . htmlspecialchars( $topic_last_poster_name) . " on: " . date("m/d/y H:i:s", $topic_last_post_time);
}
}
1 Re: Latest forum posts block
Forma 17
From: -
From: -
for the one for phpbb, could it also display the time of the last post, and who made it, and also the post count?
You made one before for storyteller like this
You made one before for storyteller like this
1 Re: Latest forum posts block
DSF2 19
From: -
From: -
There is is a block available for SMF ?
Thank You,
Thank You,
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
This should work for phpBB 3:
<?php
if( !defined( "CONTENTTELLER" ) )
{
die( "Error" );
}
$pbb_latest = ( isset( $datastore[ 'pbb_latest' ] ) ) ? $datastore[ 'pbb_latest' ] : "" ;
if( !$pbb_latest )
{
global $uwrapper;
$pbb_latest = "";
$uwrapper -> bbconnect();
$results = $uwrapper -> bbquery( "SELECT topic_id, topic_title, forum_id FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE topic_approved = '1' ORDER BY topic_last_post_time DESC LIMIT 10" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum ) = $database -> dbrow( $results ) )
{
$length = 22;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$pbb_latest .= "· <a href=\"" . $preferences['website_uwrapper_forumpath'] . "/viewtopic.php?f=" . $forum . "&t=" . $threadid . "\">" . htmlspecialchars( $title ) . "</a><br />";
}
}
$uwrapper -> bbclose();
$system -> datastoreput( "pbb_latest", $pbb_latest );
}
echo $pbb_latest;
?>
1 Re: Latest forum posts block
Ryster 4
From: -
From: -
Hi there, could you possibly whip up a similar block for phpbb3 recent articles too please? IPB was nice until they made you start paying for it. I don't want to pay just for a clan website with 30 members.
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
This following should work. Change:
to:
$ipb_latest .= "· <a href=\"" . $preferences['website_uwrapper_forumpath'] . "/index.php?act=ST&f=" . $forum . "&t=" . $threadid . "\">" . htmlspecialchars( $title ) . "</a><br />";
to:
$ipb_latest .= "· <a href=\"" . $preferences['website_uwrapper_forumpath'] . "/index.php?act=ST&f=" . $forum . "&t=" . $threadid . "\">" . $title . "</a><br />";
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
can& # 3 9 ;t restart Windows from DOS
You see now?
It shows & # 3 9 ;
instead of '
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
can't restart Windows from DOS
instead of
can't restart Windows from DOS
I don't see a difference
1 Re: Latest forum posts block
error
OP
232
From: -
From: -
It works well. I get only one issue.
can't restart Windows from DOS
instead of
can't restart Windows from DOS
What can be problem?
can't restart Windows from DOS
instead of
can't restart Windows from DOS
What can be problem?
1 Re: Latest forum posts block
Philipp Esselbach
From: -
Editor
0From: -
Create a new blocks/ipb_latest.php file with the following content:
You may need to adjust this SQL query to exclude private forums:
For example, if you like to exclude forum 10 and 15 from the list just change the query to:
<?php
if( !defined( "CONTENTTELLER" ) )
{
die( "Error" );
}
$ipb_latest = ( isset( $datastore[ 'ipb_latest' ] ) ) ? $datastore[ 'ipb_latest' ] : "" ;
if( !$ipb_latest )
{
global $uwrapper;
$ipb_latest = "";
$uwrapper -> bbconnect();
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics ORDER BY last_post DESC LIMIT 10" );
if( $uwrapper -> bbrows( $results ) )
{
while( list( $threadid, $title, $forum ) = $database -> dbrow( $results ) )
{
$length = 22;
if ( strlen( $title ) > $length)
{
$title = substr ( $title, 0, $length ) . "...";
}
$ipb_latest .= "· <a href=\"" . $preferences['website_uwrapper_forumpath'] . "/index.php?act=ST&f=" . $forum . "&t=" . $threadid . "\">" . htmlspecialchars( $title ) . "</a><br />";
}
}
$uwrapper -> bbclose();
$system -> datastoreput( "ipb_latest", $ipb_latest );
}
echo $ipb_latest;
?>
You may need to adjust this SQL query to exclude private forums:
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics ORDER BY last_post DESC LIMIT 10" );
For example, if you like to exclude forum 10 and 15 from the list just change the query to:
$results = $uwrapper -> bbquery( "SELECT tid, title, forum_id FROM " . $uwrapper -> bbescape( $preferences[ 'website_uwrapper_prefix' ] ) . "topics WHERE NOT(forum_id = '10') AND NOT(forum_id = '15') ORDER BY last_post DESC LIMIT 10" );
I would like to see Latest 10 forum posts in a block. Similar to Latest News. Also with choice too limit text length.
Thanks