|
|
Joined: Jan 2001
Posts: 374
Enthusiast
|
Enthusiast
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.
|
|
|
|
Joined: Aug 2002
Posts: 111
Journeyman
|
Journeyman
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?
|
|
|
|
Joined: Aug 2002
Posts: 218
Member
|
Member
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...
|
|
|
|
Joined: Aug 2002
Posts: 111
Journeyman
|
Journeyman
Joined: Aug 2002
Posts: 111 |
So the reference to newpost.tmpl is an error? I'm just confirming I didn't miss anything.
|
|
|
|
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 
|
|
|
|
Joined: Aug 2002
Posts: 111
Journeyman
|
Journeyman
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.
|
|
|
|
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 
|
|
|
|
Joined: Jan 2001
Posts: 374
Enthusiast
|
Enthusiast
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. <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 />
|
|
|
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.
|
|
Posts: 449
Joined: February 2008
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|