vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   News "Hack" (https://vborg.vbsupport.ru/showthread.php?t=40241)

Link14716 06-23-2002 10:00 PM

News "Hack"
 
Ok, I made a news ticker hack. This is my first hack. YAY!

Description:
This hack allows you to enter a message in the General Settings part of vBulletin Options in your Admin CP. Enter $news anywhere on any template and the message will show up.

HUGE credit to Xenon for showing me how to get the variables to work. Without him, this wouldn't exist.

Credit to Andy Sookram for the news ticker.

News Ticker found here.

To do:
1 MySQL Query
1 File Edit
? Template Modification(s)

Enjoy!

UPDATE 12/22/02
I decided to give this simple little hack an update. It no longer adds a query, and it is less confusing to install. Enjoy :)

Xenon 06-24-2002 09:27 PM

thanks for the flowers :) (Common german task, hope it exists also in english ;))

an optional addition to your code:
after $news=$DB_site->query_first("SELECT * FROM setting WHERE settingid=x");
put this:
$news[value]=bbcodeparse2($news[value],1,1,1,1);
so you can use bbcode and smilies in your news too

Link14716 06-24-2002 09:30 PM

Cool.

/me updates own global.php, the .txt file, and gives Xenon some candy.

Velocd 06-24-2002 09:39 PM

When you say "news", what exactly are you referring to? The announcements?

Xenon 06-24-2002 09:42 PM

I would call it a message Hack.
You could enter a message and can decide where to show up.

in the header template or wherever.

News is really a bit unprecious name :)

Link14716 06-24-2002 09:52 PM

Yea, more of a Message hack. I use it in a news ticker (and another installation, with $news2 for a fader). So, someone might as well rename the topic to "Message" hack so no one gets confused on what I mean ;)

MrLister 06-25-2002 02:01 AM

Congradulations on your first hack! Great job!

Link14716 06-25-2002 04:26 AM

Attached is a News Ticker that is tested to work for it (heck, I made it for this ticker.) Credit for the ticker goes to Andy Sookram.

Chris M 06-25-2002 10:31 AM

Great!

Saves me the trouble of making it:)

*installs*

Satan

Link14716 06-27-2002 10:29 PM

Thanks for the compliments.

Right now I am trying to get the BB Code parsing to work in newsfaders. Everytime I try, the news doesn't show up, but I will get it eventually. ;)

Chris M 06-28-2002 12:29 PM

:)

Satan

Robert9 06-28-2002 04:29 PM

congratz! this would go well if I alrady didnt have mine ony my forums (feel free to somewhat use) www.ecforums.com/forums if you need it. I love the gradient backround

Crazy Mofo 06-30-2002 08:33 PM

what news ticker u using Rober9?

Crazy Mofo 07-01-2002 05:32 PM

/me bump

Schumi 07-01-2002 07:50 PM

hi,

I ran the query in phpMyAdmin, but i got the following mistake:

Quote:

Fehler
SQL-Befehl : [?ndern]

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorder) VALUES (NULL,2,\'News\',\'$news\',\'\',\'Insert forum news here...\',\'textarea\',\'7\');
MySQL meldet: You have an error in your SQL syntax near '\'News\',\'$news\',\'\',\'Insert forum news here...\',\'textarea\',\'7\')' at line 1

Zur?ck
Who can help me?

best regards
Schumi

Link14716 07-02-2002 03:48 AM

It would help if it where english, since that is my ONLY language, but, I think I know the problem.....

Are you using phpMyAdmin 2.2.0 or something?

Anyways, to get it to work, go into the setting table, see what the bottom settingid is (make sure you have it to view all), and add a new row.

Setting ID: 1 above the last one
Setting Group ID: 2

News
news

Insert forum news here..........
textarea
7

That should do it.

Radon3k 07-02-2002 05:21 AM

Satan gave you a compliment! :surprised:

I'm not sure if that's good or bad... :laugh: :D :)

Schorsch 07-08-2002 05:29 AM

Quote:

Originally posted by Robert9
congratz! this would go well if I alrady didnt have mine ony my forums (feel free to somewhat use) www.ecforums.com/forums if you need it. I love the gradient backround
where can I download the newsscript YOU use ??? that looks pretty nice!!!

thanks,
Schorsch

Schorsch 07-19-2002 03:05 AM

*bump*

Link14716 07-19-2002 08:50 PM

Let me "shed" some light on this.

He is using a javascript news fader. You can get a hack to have a fader somewhere around here (doesn't exactly require a hack, but it makes it considerably better), just use the little search box. :D

Also, the optional step in the text file has not worked for me with javascript faders, so I am guessing that it won't work with any javascript.

Schorsch 07-20-2002 05:02 AM

jep I already tried to install THIS Newsfader Hack, but it doesn't work :( :(

so is there no damn working simple news fading hack on the world ??

*gg*

cu
Schorsch

Link14716 12-23-2002 01:19 AM

UPDATE 12/22/02
I decided to give this simple little hack an update. It no longer adds a query, and it is less confusing to install. Enjoy :)

XrayHead 02-01-2003 08:08 PM

Hi Link14716

I installed you hack into my test forums but can?t seem to get it to work correctly. All I get scrolling across the screen is the first letter ONLY of the news I enter in the general settings.
Any ideas?

XrayHead
:confused:

Link to example.............here!!

Drowning Inside 02-01-2003 09:08 PM

Quote:

Originally posted by XrayHead
Hi Link14716

I installed you hack into my test forums but can?t seem to get it to work correctly. All I get scrolling across the screen is the first letter ONLY of the news I enter in the general settings.
Any ideas?

XrayHead
:confused:

Link to example.............here!!

Same with me :confused:

XrayHead 02-01-2003 09:10 PM

Yeh, This is a real bummer as it looks really nice and would be very usefull indeed....................

Drowning Inside 02-01-2003 09:12 PM

Yeah! i was so excited to use it...then..i just saw my little T going across and was like...damn

Link14716 02-01-2003 09:33 PM

Well, I must have messed up when I updated this hack, hold on...

Link14716 02-01-2003 09:37 PM

Did you use the EXACT code (or very close to it) in the attachment with the HTML code for the news ticker? If you did, in the header template, change $news[value] to $news. I don't see anything else that might be causing it.

Drowning Inside 02-01-2003 09:53 PM

BTW, would there be any way to make it so that we could use $username, $totalposts...or other things in it?

Link14716 02-01-2003 09:56 PM

As far as I know, there isn't, unless you hard-edit it into the template. Sorry.

EDIT: I could eval it, although it won't let you use bbcode (you'd have to use HTML). Let me see if I can get this to work.

Drowning Inside 02-01-2003 09:57 PM

Damn... thanks, though

Link14716 02-01-2003 09:59 PM

Not tested, but try it anyways:

In global.php, find:
Code:

$news=bbcodeparse2($news,1,1,1,1);
Replace with:
Code:

eval("\$news = \"$news\";");

Link14716 02-01-2003 10:05 PM

It'd let you use HTML code and PHP variables (of course you won't be able to use smilies or bbcode).

XrayHead 02-02-2003 09:16 AM

Thanks for the reply, It works OK now.

Link14716 02-02-2003 05:52 PM

No problem. Glad you like it. :)

CityInet 03-20-2003 04:08 PM

i dont understand. I have the ticker working, but I don't understand where i enter the news to be used by the ticker.

As you can see at www.warvoice.com, on the right hand side, below to news feed, I have it set up with a static message. load the $news variable.

Where does it pull the data from?


All times are GMT. The time now is 10:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01263 seconds
  • Memory Usage 1,780KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete