Previous Thread
Next Thread
Print Thread
Rate Thread
#222216 08/09/2002 7:42 AM
Joined: Aug 2002
Posts: 17
Newbie
Newbie
Offline
Joined: Aug 2002
Posts: 17
Hi guys

A while ago (back when I was running 5.4 Perl), there was a modification that would display 1 post from another forum as a "headline" on a forum. I was using this to display new product alerts in a forum linked to a store I run. Since switching to 5.5 PHP, and now upgraded to 6.0.2, I can't find this code anywhere. Sure, I could write it myself, but if someone has already done it I would appreciate the saved time. If no-one has it, I will code it and offer it as a mod for other people.

Thanks

Sponsored Links
leo #222217 08/09/2002 8:18 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I can't remember seeing anything like that, I'm sure there is no hack for it in the v6 mods forums at least. There might be something here in the suggestions forum though, haven't checked.

Sounds like a nice idea though.

c0bra #222218 08/09/2002 8:28 AM
Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
[:"red"] news flash hack [/] I do believe the name of it is

interforos #222219 08/09/2002 8:40 AM
Joined: Aug 2002
Posts: 17
Newbie
Newbie
Offline
Joined: Aug 2002
Posts: 17
That's the one! Any idea where I can find it?

leo #222220 08/09/2002 9:36 AM
Joined: Aug 2002
Posts: 17
Newbie
Newbie
Offline
Joined: Aug 2002
Posts: 17
ok, so I found out that the ubbtnews.php code that's in the /addons directory will do exactly what I want, but I cannot figure out how to include it. It says I have to use the php include command wherever I want it to appear, but how can I do this in a middle of a template? Is there a special technique to including actual PHP code in a template?

Thanks

Sponsored Links
leo #222221 08/09/2002 10:37 AM
Joined: Aug 2002
Posts: 17
Newbie
Newbie
Offline
Joined: Aug 2002
Posts: 17
Never mind, solved my own problem...just took me a while to understand how the templates worked. It's working great now, if anyone wants to know how, just ask. It requires modification of the templates where you want the news item to appear, and a slight mod to the ubbtnews.php code (to stop it including main.inc.php twice).


leo #222222 08/09/2002 2:54 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Sure, if you are able to share, that'd be cool


- Allen wavey
- What Drives You?
SurfMinister #222223 08/10/2002 7:43 PM
Joined: Aug 2002
Posts: 17
Newbie
Newbie
Offline
Joined: Aug 2002
Posts: 17
ok, well here's what I did. I edited ubbtnews.php to add the correct settings for my DB, and made sure it worked by running it manually from the URL line in my browser. Then I edited my template (in my case, postlist.tmpl), and added my code right underneath the following bunch of table code :

code:
</table>
</td>
</tr>
</table>
<br />



This is the code I inserted, starting on line 83 :

code:
<table width="{$theme['tablewidth']}" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="{$theme['cellpadding']}" cellspacing="{$theme['cellspacing']}" width="100%" border="0" class="tableborders">
<tr class="darktable">
<td>
<!-- UBBTPRINT; -->
include('./addons/ubbtnews.php');
<!-- echo <<<UBBTPRINT -->
</td></tr></table></td></tr></table><br />



What this does is add a new row below the main/search/my home buttons, displaying the news items however you have them set up. Once this is in, you will need to edit ubbtnews.php again, and comment out the
code:
require ("$path/main.inc.php");

line on line 53. This is because the ubbtnews.php code is no longer being called standalone, so the main.inc.php is already included.

And that's it. Sorry for the bad description, it's the first time I've tried to explain something like this to someone else.

Have fun

Grahame
=======

leo #222224 08/10/2002 8:13 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Cool, thanks for sharing


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)