Topics on External Pages!

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Post Reply
User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Topics on External Pages!

Post by Volksdevil » Tue Nov 11, 2014 7:51 pm

I really hope somebody can put something like this together. I'm sure many other members must have had custom pages pre 3.1.1 which pulled topics from chosen forums. It now no longer works :cry:

I think the old queries just need updating?

An example of one of my old custom page templates that no longer works:
Not too big as you can see, may be a slight div/styling error as I've just removed google ads from it.

Code: Select all

<div itemscope itemtype="http://schema.org/Article">
<h2><a href="http://www.corradog60.com/classifieds.php" itemprop="url"><span itemprop="name">{PAGE_TITLE}</span></a></h2>

<div id="col1">
<!-- PHP -->
// configuration
global $db;
global $phpEx;
// global $auth;
$forum_id_array = array(25,26,27,28,29,30); // forum_ids to pull topics and posts from
$sql_limit = 12; // number of topics to display
$number_of_chars = 250; // number of characters for text
{
echo '<!-- <h2><strong>' . $row[$i]['topic_title'] . '</strong></h2> -->';
}
// auth
$auth_forum_id = array();
foreach ($forum_id_array as $forum_id)
{
// if ($auth->acl_get('f_read', $forum_id))
{
$auth_forum_id[] = $forum_id;
}
}
// recent topics
$sql = 'SELECT t.*, p.post_text, p.bbcode_uid
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . POSTS_TABLE . ' p
ON t.topic_first_post_id = p.post_id
WHERE t.topic_approved = 1
AND ' . $db->sql_in_set('t.forum_id', $auth_forum_id) . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $sql_limit);
$row = $db->sql_fetchrowset($result);
for ($i = 0; $i < $sql_limit; $i++)
{
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row[$i]['forum_id'] . '&t=' . $row[$i]['topic_id']);
// prepare text (strip bbcodes and trim it)
$text = $row[$i]['post_text'];
strip_bbcode($text, $row[$i]['bbcode_uid']);
$text = (strlen($text) > $number_of_chars) ? substr($text, 0, $number_of_chars) . '...' . '<br><strong><span class="red">Full advert <i class="fa fa-arrow-right"></i> [ <a title="' . $row[$i]['topic_title'] . '" href="' . $topic_url . '">' . $row[$i]['topic_title'] . '</a> ]</span></strong><br>' : $text;
echo '
<div class="panel" style="background-color: #FFFFFF;">
    <div class="inner"><span class="corners-top"><span></span></span>
        <div class="content"><h2><strong><i class="fa fa-arrow-right"></i> <a title="' . $row[$i]['topic_title'] . '" href="' . $topic_url . '">' . $row[$i]['topic_title'] . '</a></strong></h2><p><!-- <strong><span class="red">Full advert <i class="fa fa-arrow-right"></i> [ <a title="' . $row[$i]['topic_title'] . '" href="' . $topic_url . '">' . $row[$i]['topic_title'] . '</a> ]</span></strong><br> -->' . $text . '</p></div>
    <span class="corners-bottom"><span></span></span></div>
</div>
';
}
{
echo '<br>';
}
$db->sql_freeresult($result);
<!-- ENDPHP -->
</div>

<div id="corradog60">

<p>I hope you enjoy the site...I can be found on <a href="https://www.facebook.com/neilriley" class="postlink_ext" rel="nofollow" target="_blank">Facebook here</a> if you want to throw me a friend request.<br>Neil.</p>
</div> -->


<div id="col2">
<div class="mini-panel" style="border: 2px solid #000000;">
    <div class="inner"><span class="corners-top"><span></span></span>
            <h3>Corrado G60 For Sale</h3>
            <ul class="menurules">
<li><a href="http://www.corradog60.com/viewforum.php?f=25"><i class="fa fa-arrow-right"></i> Corrado G60 Parts For Sale</a></li>
<li><a href="http://www.corradog60.com/viewforum.php?f=26"><i class="fa fa-arrow-right"></i> Corrado G60 Wheels For Sale</a></li>
<li class="last"><a href="http://www.corradog60.com/viewforum.php?f=27"><i class="fa fa-arrow-right"></i> Corrado G60 Cars For Sale</a></li>
            </ul>

            <h3>Corrado G60 Wanted</h3>
            <ul class="menurules">
<li><a href="http://www.corradog60.com/viewforum.php?f=28"><i class="fa fa-arrow-right"></i> Corrado G60 Parts Wanted</a></li>
<li><a href="http://www.corradog60.com/viewforum.php?f=29"><i class="fa fa-arrow-right"></i> Corrado G60 Wheels Wanted</a></li>
<li class="last"><a href="http://www.corradog60.com/viewforum.php?f=30"><i class="fa fa-arrow-right"></i> Corrado G60 Cars Wanted</a></li>
            </ul>


    <span class="corners-bottom"><span></span></span></div>
</div>
</div>

</div><!-- end of article -->
Unless somebody can make an add-on for the official 'Pages' extension' or at least just provide some updated code that will do the job?
Last edited by Volksdevil on Sat Nov 15, 2014 2:23 pm, edited 2 times in total.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4991
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: 'Pages' Add-on? Pull Topics from forums!

Post by VSE » Wed Nov 12, 2014 5:51 am

What you want is just a simple stand alone extension that shows a page with recent topics from selected forums. You'll have better luck if you edit your post and title, to improve the chances of somebody remaking your "classifieds.php" script into an extension for you.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Pull Topics from forums! / 'Pages' Add-on?

Post by Volksdevil » Wed Nov 12, 2014 3:22 pm

Updated opic slightly, I guess all I need is the updated query that works with 3.1.1? I'd just hoped that as your extension already 'creates' pages that I could add the query in one of the pre-populated templates that can be added.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4991
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Pull Topics from forums! / 'Pages' Add-on?

Post by VSE » Wed Nov 12, 2014 7:52 pm

Volksdevil wrote:Updated opic slightly, I guess all I need is the updated query that works with 3.1.1? I'd just hoped that as your extension already 'creates' pages that I could add the query in one of the pre-populated templates that can be added.
An updated query will not help you. An SQL query can not be run from templates, even inside those PHP tags, in an extension. It's also a very bad practice as it exposes your code to prying eyes.
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Pull Topics from forums! / 'Pages' Add-on?

Post by Volksdevil » Thu Nov 13, 2014 1:17 am

Bummer. Although 3.1 is good, it's not half a lot of hassle, loss of time, work, money with losing pages etc. :?
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Topics on External Pages!

Post by Volksdevil » Wed Nov 19, 2014 4:41 pm

OK, Forget the idea of an add on for the pages extension. Can anybody help with updating the code in my first post to work on 3.1.1?
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
nextgen
Jr. Style Validator
Posts: 2341
Joined: Mon Jul 26, 2010 10:58 pm
Location: Guatemala
Name: Melvin García
Contact:

Re: Topics on External Pages!

Post by nextgen » Wed Nov 19, 2014 5:02 pm

メルビン・ガルシア • phpBB Development StylesphpBB Argentina - Soporte en español 🇦🇷

Please do NOT contact for support via PM or email.

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Topics on External Pages!

Post by Volksdevil » Wed Nov 19, 2014 5:19 pm

Cheers, I've seen that and posted there with no response as yet.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Topics on External Pages!

Post by Volksdevil » Tue Dec 02, 2014 7:14 pm

Can anyone help? :)
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

sopi
Registered User
Posts: 91
Joined: Mon Nov 24, 2008 11:35 am

Re: Topics on External Pages!

Post by sopi » Wed Dec 03, 2014 8:07 pm

I think what you're looking for is actually this one:
viewtopic.php?f=461&t=2211266
(from nickvergessen)

And the download page can be found here:
https://github.com/nickvergessen/phpbb3-mod-newspage

(I couldn't get it to work for some -probably/hopefully- stupid reason, though :oops: but it should be easy [maybe I just need another coffee :roll: ])
EDIT: Works great. Used wrong link :roll: :oops:

Cheers
sopi :)
Last edited by sopi on Fri Dec 05, 2014 4:53 am, edited 1 time in total.

timeforhelp1
Registered User
Posts: 214
Joined: Thu Feb 19, 2009 5:34 pm

Re: Topics on External Pages!

Post by timeforhelp1 » Thu Dec 04, 2014 6:34 pm

This still works...
viewtopic.php?f=496&t=2269016

Post Reply

Return to “Extension Requests”