Previous Thread
Next Thread
Print Thread
Rate Thread
#231735 01/04/2003 4:44 PM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
[:"red"]
Mod Name / Version: TopNews Hack 1.0.1

Description: An easy way to place a short urgent new on top of the board.

Author(s): Carl Erling (caymuc)

Originally By:

Date: 4/Jan/03

Updates: 5/Jan/03,

Working under: UBB.threads 6.2

Any pre-requisites: none.

Files Altered: ubbt.inc.php, /admin/menu.php

Database Altered: No.

New Files: one empty file for the included-folder

Special Notes: Quick and dirty hack to display an urgent warning or news on top of the board. Something everybody will notice right away. Ment only for news with one short text-string. Text can be put in from the ADMIN menu just like the header include. - Yes also good for "Happy new Year!" displays <img src="/threads/php/images/graemlins/smile.gif" alt="" />

Is there a better place for the news?
Maybe where the birthdaygreeting goes?

[/]

----------------------------------------------------
Here's the HACK:


1.
In ADMIN / MENU.PHP, look for

<b>Includes</b>
</td></tr>
<tr><td valign=top class=lighttable>

and add right underneath:

<!-- TopNews Hack 1.0 -->
<a href="{$config['phpurl']}/admin/editincludes.php?Cat=$Cat&include=topnews" target="mainFrame">
Edit Topnews-Line
</a>
<br>
<!-- TopNews Hack end -->



2.
Put a new empty file in your includes folder.
Name it:
"topnews.php"




In UBBT.INC.PHP, find

// ----------------------------------------------------
// If they have private messages we give the PM flasher
// as long as they didn't just log out


and add ABOVE it:

// TopNews-Hack 1.0 by Carl Erling (caymuc)
// ----------------------------
// require the topnews.php include file
if (!$debug) {
echo "<div align="center"><table width="90%" border="0" cellspacing="0" cellpadding="2"><tr><td align="center" valign="middle">";
@include "$thispath/includes/topnews.php";
echo "</td></tr></table></div>";
}
// TopNews-Hack end


That's it. Hope you like it.

Last edited by JoshPet; 07/23/2003 10:22 PM.
Sponsored Links
Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
I tried this hack because I run a fansite, and thought it would be a good place to list guest appearances on TV shows, convention appearances, etc.

However, I can't get it to work.

I can edit topnews.php in my Admin section, but it doesn't appear on the main page. I notice the file list says "newpost.tmpl, ubbt.inc.php, /admin/menu.php" -- is the mod missing the changes for newpost.tmpl?

jbiz #231737 02/16/2003 6:11 PM
Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Tried it and its working fine for me. Please follow the instructions again, I am sure that you've forgotten something...

edr #231738 02/16/2003 6:49 PM
Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
So the reference to newpost.tmpl is an error? I'm just confirming I didn't miss anything.

jbiz #231739 02/16/2003 10:38 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
It doesn't look like it should touch anything called newpost.tmpl, I don't see it in the instructions Recheck your work in admin/menu.php file... maybe there's a conflict with something else added


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
"newpost.tmpl" is listed in the "files altered" in the instructions. No, there aren't any specific instructions to change it, that's what I was trying to clarify. Perhaps someone should edit the first post in this thread to remove the reference to it?

As for my problems with the mod, they seem to be in ubbt.inc.php. I can modify the topnews.php file correctly via the admin panel, but I can't view it on my threads board. I'll keep trying.

jbiz #231741 02/16/2003 11:52 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
hehe... sorry, didn't see that - yes, it looks like it needs to be removed from the first post


- Allen wavey
- What Drives You?
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
I was away for some days. Is there still a problem with the hack?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
If you insert this code instead, into your ubbt.inc.php then the topnews won't appear when you are in the admin section.... so that you can still see your menu bar when you are in admin.

Code
<br />//TopNews-Hack 1.0 by Carl Erling (caymuc) <br />// ---------------------------- <br />// require the topnews.php include file <br />if (!$debug) { <br />	// - Don't display in admin section.... by JoshPet<br />	$What = find_environmental("PHP_SELF");<br />	$script['0'] = "";<br />	preg_match ("/(.*)\/(.*).php/",$What,$script);<br />	$What     = $script['2'];<br />	if (!preg_match("/\/admin$/",$script['1'])) {<br />		echo "<div align=\"center\"><table width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr><td align=\"center\" valign=\"middle\">"; <br />		@include "$thispath/includes/topnews.php"; <br />		echo "</td></tr></table></div>"; <br />	}<br />} <br /><br />// TopNews-Hack end <br /><br />


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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
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-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)