View Full Version : Logician NEWS: Drag Any Message to Your Main Page
Logician
05-30-2002, 10:00 PM
This is a news script which will drag vb forum messages from your vb db to your non-vb main page/news page. There are a lot of good news script around but I needed a highly customizable main page news script with some special features and wrote it myself. I'm using it in my site's main page for a long time, but I was just too lazy to write installation/help documents to share it here, sorry! :)
FEATURES:
* This script simply pulls forum messages which you marked as "news" from your vb database and post them in your non-vbulletin (main/other) page.
* You can mark messages as "NEWS" in any forum you want (including private forums). You dont need to restrict your news to a specific forum.
* You can drag any message to your main page, regardless of its date. So news is NOT supposed to be the most recent messages in your board.
* You do NOT have to carry the whole message to your main page as news. You can import it all or simply take some part of it. So eg. you can drag a message's the first paragraph to your news page and link the thread for "Read More".
* Moreover you can insert invisible custom NEWS text which will be dragged to your main page to your board messages, but not shown in the original forum thread. So your original thread message and news text on your main page can be different than eachother.
* You can have sticky news in your main page (even if they are not sticky in your forum).
* News does NOT need to be the first message in the thread. You can tag any reply message as news and pull it to your main page either.
* Script parses ALL of your message icons/smilies (including your custom add-ons) and some of the important vBCode like: [url] [email] [img] [b] [i] [u]
* You can specify which members may post news.
* You can form your News' title seperately, apart from of the original thread/message title.
* You can set maximum number of news shown in your main page.
* You can set maximum number of characters that all shown news should not exceed. Some messages can be long and some can be short and if you set a character limit, the script will automatically compile enough news from your database to fit your web page's relevant part according to the limit you set.
* You can enable/disable:
News Poster Name
News Date
News Read Number
News 'Send to a Friend' Link
Comment number/Add comment button/Last commenter
Will viewing news increase the original thread's view count or not
News is sticky or not
for ALL your news INDIVIDUALLY.
* All news tags are invisible in the original thread. So forum readers do not notice any difference when you tag a message as news.
* Dragging a message to your main page as news is as simple as inserting a hidden Title of My News tag to your forum message.
Well, these features are what I needed in my news script, so it should suffice to you too! :)
It's an easy to install script and will work with ALL vbulletin versions because it's an add-on, not a hack. I can give support as much as I have time, but please ask here, not via email or PM.
If you use the script, please click INSTALL (https://vborg.vbsupport.ru/misc.php?s=&action=install&threadid=39278). If you post the URL of your news page after installation, you can help other users see the script in action in different pages and in custom designs, thank you!
Logician
Logician
05-31-2002, 07:51 PM
Demo Site:
* Demo news page (http://www.turkhukuksitesi.com/newsdemo/news.php) (Check this first, it's in English)
Sites using this script:
* My Site's main page (http://www.turkhukuksitesi.com) (Non-English, but you'll see it in real action) :)
* Wildthinks' Site (http://www.swishzone.net) (German)
* http://www.terrapinsgonewild.com/
One final comment: the graphical design of "news" in these pages are not mandatory by the script. You can design it as you like with plain HTML, so the script is flexible for design of the news. As you may already noticed, I and Wildthinks use it in different designs.
Logician
05-31-2002, 07:52 PM
HOW TO USE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
After you install the script, all you have to do is to mark some messages as "news" to drag them yo your main page. To tag messages you will use [summary] and [options] tags, all of which are invisible in the original thread.
If you authorized some forums or members for news posting in the newsconfig.php options, remember to use authorized member(s)' name and post in the authorized forum when marking your messages. (An optional precaution you may regard to prevent ordinary users to post news by using these tags)
To mark a message, simply use [news] tag in your message body. The text you insert between, will be your news title in the main page.
eg. This is a News Title
The tag alone is enough (and the only required tag) to mark any message as news and it will drag the whole message to your main page.
If you dont want to drag the entire message, but pull only some part from the begining(or else), use that part in [intro] .(And of course still [news] tag is required since it tags the message as news). For example you can use [intro] tag to take the first paragraph of your message to your main page and the script will link your original thread with a "Read More" remark.
eg.
[news]My News
my introduction that will be dragged to news page
Other paragraphs which will NOT be dragged to news page..
If you want to use an entirely different text as your news body, use it in tags. So for example in a hot thread you can send a reply to one of the members and in your message you can use hidden 'We are discussing subject X in our forum.. Join!' tag, to post this text to your main page as news and link the original thread. Forum viewers will only see your original forum reply in the forum but main page visitors will be notified by your custom text.
eg.
My News
my news paragraph that will be dragged to news page but hidden in the original thread
Other paragraphs which will NOT be dragged to news page and visible to thread readers..
And finally we have an optional tag, which helps you to customize your news. For all of your news, you can individually disable these options: Send a Friend Link(sendfriendoff), Thread view number(viewsoff), News Poster's name(posteroff), News Date(dateoff), News Comments&Add a Comment Link(commentsoff), News' last commenter's name(lastcommenteroff), whether news shown on the main page increases thread's view number or not (countoff), whether news is sticky (sticky) and whether you want to crunch (removes newlines) news text (crunch) in your main page. Use the tags in paranthesis to disable relevant option like sendfriendoff lastcommenteroff countoff (Exceptions= (sticky) and (crunch). They enable the option.)
Ok that's it..
Enjoy! \\=^))
Logician
zachb
05-31-2002, 07:58 PM
Wow! That looks great. Awesome job, Logician!
Lesane
05-31-2002, 08:10 PM
Looks great indeed, well done.
SaintDog
06-01-2002, 12:43 AM
Great job Logician,
I was actually on the look for a good news script, this is even better as I can use now use vBulletin as well (which is how I preferred it).
Keep up the great work!
- SaintDog
JulianD
06-01-2002, 02:27 AM
Looks great, I might test this one! Thanks! :D
Unknown553
06-01-2002, 03:42 AM
Well, with a good 45 minutes of customizing and getting the hang of it, I finally got it looking and working exactly how I wanted it to. Great script, highly customizable and functional. Awesome work Logician, and thank you for a great, much needed vB addon. :)
inetd
06-01-2002, 05:51 AM
Logician, ypou really the best!!!
Dean C
06-01-2002, 10:06 AM
pretty nice...
WebMasterAJ
06-02-2002, 03:32 AM
Alright, I probably have the dumbest question ever. First, let me say this script is FANTASTIC. However, is there any way for me to make it "View 179 Times" instead of "197 Times Viewed".
I've tried to do this on my own... but always got an error... so I must of been doing somethin wrong.
Anyways... THANKS FOR THE GREAT SCRIPT!
Logician
06-02-2002, 08:08 AM
Originally posted by WebMasterAJ
However, is there any way for me to make it "View 179 Times" instead of "197 Times Viewed".
Easy.. In newsconfig.php, find:
$replace_text=$news[$i][views].' Times Viewed';
Replace it as:
$replace_text='View '.$news[$i][views].' Times';
Enjoy.. ;)
Unknown553
06-02-2002, 08:50 PM
Ok, got almost everything working right. I just noticed that the time I posted the news is always the current time, so I need some help with that. I changed some return date () code, but it clearly didn't work. I want to have the time is this format (in PHP): M. jS, Y \a\\t g:i A. Can someone help me get the correct time in there?
Logician
06-03-2002, 05:25 AM
Originally posted by Unknown553
Ok, I want to have the time is this format (in PHP): M. jS, Y \a\\t g:i A. Can someone help me get the correct time in there?
Edit "phpheader.php", find:
return date ("Y-d-m H:i:s", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
and edit "Y-d-m H:i:s" part according to your wish..
Ihsahn
06-03-2002, 06:49 AM
mmm ... looks very handfull ... i have a try with your hack ...
Thx a lot Logician :)
Unknown553
06-03-2002, 07:43 PM
I tried that, and it returned: Dec. 31st, 1999 at 12:02 PM
Logician
06-03-2002, 07:56 PM
Originally posted by Unknown553
I tried that, and it returned: Dec. 31st, 1999 at 12:02 PM
And? What does it suppose to return? it seems that this is the date format you asked, isnt it? Confused here lol
Unknown553
06-03-2002, 09:08 PM
Originally posted by Logician
And? What does it suppose to return? it seems that this is the date format you asked, isnt it? Confused here lol
I didn't post it 3 years ago....
Logician
06-04-2002, 08:04 AM
Originally posted by Unknown553
I didn't post it 3 years ago....
I checked that out and couldnt find any bugs, it works for me: ie date is displayed in the format you want and correctly.
1- Please double check you modified the correct line:
return date ("Y-d-m H:i:s", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
will be:
return date ("M. jS, Y \a\\t g:i A", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
2- Make sure your post date is correct: News date is the date of your thread message, not the date you inserted [news] tags. So if you tag an old message as news, its news date will be old either.
If these do not work:
a) Give me the URL of your board message and news page so that I can check them out (Edit: Never mind I already checked them)
b) Send me your phpheader.php (as you modified)(delete password), newsconfig.php and your news message's entire text (with option tags you used). You can zip them and send via pm..
Regards,
Logician
Wildthinks
06-04-2002, 11:19 AM
Hi Logician,
thx for this very good script...any wish form me:
- config with parameter for show only headers on site where i it wont and the completnews on a other page
- colorsupport (don't work on my page)
- more - button, when I have more then x-news
- search the news....
:rambo: it's unbelievable, but works fine :cheeky:
rkettner
06-04-2002, 10:42 PM
Although I love this script (GREAT JOB), one feature missing. I can't use my custom vb code within posts.
Example: I use and to center images in news posts. Of course, the code translates to HTML that does the centering work.
Unfortunately, the news output does not center the images, and reveales the [center] codes.
ANY FIXES?
rkettner
06-05-2002, 12:46 AM
One more thing... it seems quotes don't work in titles. For example..
This type of title works perfectly
This type of title "does not" work
Is there any fix for this?
Logician
06-05-2002, 11:07 AM
it seems quotes don't work in titles
Yep good catch. I have to work on that for sometime but here is quick fix for you if you need to use " in the title:
In newsconfig.php, find:
preg_match("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and replace it as:
preg_match("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and find:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
and replace it as:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
it should do the trick..
I can't use my custom vb code within posts.
This is not a bug. As I said in my original post the script parses ALL your smilies and message icons and SOME of your important vb code. This behaviour is intentional. I could add a feature to parse all your vb code, but I didnt want to add an extra SQL query as this script is intended to be a main page script which means it will run so many times and every query we save in such a script will significiantly increases your SQL performance. Therefore I just added the feature to parse only important vb codes like [i] [b] [u] [email] [url] and [image]. If you want to add others, you can do it with little PHP knowledge and some practise:
Check the code:
$news[$i][pagetext]= preg_replace("/(\[)(b)(])(.*)(\[\/b\])/siU", "<b>\\4</b>",$news[$i][pagetext]);
You can use this sample to add extra vbcode. For example add this line after them:
$news[$i][pagetext]= preg_replace("/(\[)(center)(])(.*)(\[\/center\])/siU", "<div align='center'>\\4</div>",$news[$i][pagetext]);
Not tested but this should parse [center] tag correctly.
Regards,
Logician
rkettner
06-05-2002, 04:37 PM
Originally posted by Logician
Yep good catch. I have to work on that for sometime but here is quick fix for you if you need to use " in the title:
In newsconfig.php, find:
preg_match("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and replace it as:
preg_match("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and find:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
and replace it as:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
it should do the trick..
This is not a bug. As I said in my original post the script parses ALL your smilies and message icons and SOME of your important vb code. This behaviour is intentional. I could add a feature to parse all your vb code, but I didnt want to add an extra SQL query as this script is intended to be a main page script which means it will run so many times and every query we save in such a script will significiantly increases your SQL performance. Therefore I just added the feature to parse only important vb codes like [i] [b] [u] [email] [url] and [image]. If you want to add others, you can do it with little PHP knowledge and some practise:
Check the code:
$news[$i][pagetext]= preg_replace("/(\[)(b)(])(.*)(\[\/b\])/siU", "<b>\\4</b>",$news[$i][pagetext]);
You can use this sample to add extra vbcode. For example add this line after them:
$news[$i][pagetext]= preg_replace("/(\[)(center)(])(.*)(\[\/center\])/siU", "<div align='center'>\\4</div>",$news[$i][pagetext]);
Not tested but this should parse [center] tag correctly.
Regards,
Logician
THANKS!
What code would I add in order to parse list tags? I regularily use bulleted lists on my page, and would like to continue to do so. Is that possible?
Logician
06-06-2002, 08:48 AM
Originally posted by Unknown553
I didn't post it 3 years ago....
@Unknown553: I figured out your problem, you modification was wrong:
Only this line should have been changed:
return date ("M. jS, Y \a\\t g:i A", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
A few lines above there is another line:
$gelentarih=date("Y-d-m H:i:s",$gelentarih);
it should left intact (You edited that one too) ;)
Modify this line back to original and you should be fine..
@rkettner: You asked for the most difficult vbcode LOL. Give me sometime I'll see what I can do for you to have it parsed.. (no promise though) :)
Regards,
Logician
Unknown553
06-06-2002, 09:48 PM
Originally posted by Logician
@Unknown553: I figured out your problem, you modification was wrong:
Only this line should have been changed:
return date ("M. jS, Y \a\\t g:i A", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
A few lines above there is another line:
$gelentarih=date("Y-d-m H:i:s",$gelentarih);
it should left intact (You edited that one too) ;)
Modify this line back to original and you should be fine..
Regards,
Logician
That did the trick, thank you very much Logician!
Hi!
Great hack!
Only problem which I encountered is, that when I move my news over to the vBulletin database, the dates are lost on when they are added.
Any suggestions? I could probably do it by hand, but that is a pain in the ass. :(
Thanks,
Till
Logician
06-08-2002, 12:51 AM
Originally posted by Till
Only problem which I encountered is, that when I move my news over to the vBulletin database, the dates are lost on when they are added. Any suggestions? I could probably do it by hand, but that is a pain in the ass. :(
Maybe you should only edit the news date of the messages which will be dragged to your main page. I guess these cant be more than 10 so it shouldnt be a big deal to edit them. For rest of them date is not so important because they are not displayed in the main page anyway.
There is also a hack around which helps admin to edit thread dates. This can save you from editing the dates with SQL.
Logician
06-10-2002, 11:40 AM
Originally posted by rkettner
What code would I add in order to parse list tags? I regularily use bulleted lists on my page, and would like to continue to do so. Is that possible?
As I promised:
Edit newsconfig.php, find:
$news[$i][pagetext]= preg_replace("/(\[)(url)(])(\r\n)*([^\"]*)(\[\/url\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>",$news[$i][pagetext]);
BEFORE that add:
if (preg_match("/(\[)(list)(])(.*)(\[\/list\])/siU", $news[$i][pagetext],$matches1))
{
$matches1[4]=preg_replace("/(\[\*\])(.*)/siU", "<li>\\2", $matches1[4]);echo $matches1[4];
$news[$i][pagetext]=preg_replace("/(\[)(list)(])(.*)(\[\/list\])/siU", $matches1[4], $news[$i][pagetext]);
}
This code will parse bulleted list tag.
Originally posted by Logician
Maybe you should only edit the news date of the messages which will be dragged to your main page. I guess these cant be more than 10 so it shouldnt be a big deal to edit them. For rest of them date is not so important because they are not displayed in the main page anyway.
There is also a hack around which helps admin to edit thread dates. This can save you from editing the dates with SQL.
Hi,
yeah, I checked out the hack, however it's easier to do it by hand since - as you stated - there are not more than 10.
But I am a little off with what field to modify, is it the "dateline" field? I can't really make out a field of type date or (unix)timestamp, other than the "editpost" one, which is too obvious. :)
Thanks,
Till
Logician
06-10-2002, 12:34 PM
Originally posted by Till
But I am a little off with what field to modify, is it the "dateline" field? I can't really make out a field of type date or (unix)timestamp
Yep its "dateline field" that keeps the message dates in the database. As you've noticed times are unix timestamp so if you are not familiar with converting times to unix, you should regard using the hack I mentioned.
Originally posted by Logician
Yep its "dateline field" that keeps the message dates in the database. As you've noticed times are unix timestamp so if you are not familiar with converting times to unix, you should regard using the hack I mentioned.
No, not a problem. :)
SELECT FROM_UNIXTIME(lastpost,'%y/%m/%d %h:%i') AS threadPOSTED FROM thread
Just in case anyone needs it.
Oh, or "dateline" of course! :D
Thanks for your help, Logician!
_till
Pretty simple to add this NEWS HACK
Great instruction........
_____________________________________
For those who would like to add there site
to my search engine the URL is
http://swf-empire.com
FrankR310
06-22-2002, 04:21 PM
i have it installed and it's working well but i seem to be running into an issue marking a post as news:
-i have specified myself as being able to post news along with one other person.
-i can mark a post as news using the including my posts i have made in the past.
-i CANNOT mark other member's posts as news. I include the news codes but it does not show up on the homepage.
-i had the other person able to post news post a thread and then i tried to mark it as news and it didnot pull this either.
so is this correct? i must post the post in the forum myself to be able to mark it as news?
what i wanted to do was go thru the forums and find post that were interesting and drag these to the homepage regardless of who originally made the post. i figure i can do this by allowing everyone to post news in the config file but i would prefer to avoid this if possible.
thank you for the hack!
frank
Logician
06-22-2002, 04:56 PM
Frank the owner of the post that has been tagged with [news] tag must be recognized as a news poster in options of the hack. So you cant edit someone's post and insert news tag to drag that news into your main page (UNLESS that person is allowed to post news).
Unfortunately it cant be otherwise:The hack can not know who inserted the tags, you or the post owner so it just checks the post owner's news permission if it runs into a [news] tag in a post.
Possible solutions:
a) as you figured it out, you can grant all news posting rights (or disable to option to grant it to everybody). Of course this is not recommended but it is not so bad as it looks because most people wouldnt know how to post news even if they are granted this privilage in the options.
b) You can reply the thread yourself and use [summary] tag in this thread. So forum reader wouldnt know about the hidden news message in your post, but with summary tag you can drag any message text as you like to your main page. eg. you can put other users messages in between your summary tags.
In my board I personally prefer to use summary tags to make a thread news thread.
Hope this helps a bit..
FrankR310
06-22-2002, 06:13 PM
yea i decided to do just that..reply and then use summary tags...only VERY minor issue i noticed with this is that if the thread is more than 1 page..and i reply and the reply is on the "nth" page..then the homepage link is to my reply rather than the first page of the thread...even if i use the linkme tag...i guess this way is more flexible for the news poster.
what i didnt notice in your reply is the case in which there's two people allowed to post news in the config file.
one of these people posts into the forum WITHOUT using any tags. the other person then goes and adds the tags into the post previously made by the other individual.
i.e.
post A originated without news tags in post - news poster 1
news poster 2 adds news tags to post A
post A does not get dragged to news page
OH i just remembered one other thing i wanted to ask you! the message at the bottom of the page that says "Time to compile news .xxx secs" i have run time set to "0" but it is still showing the message.
Oh yea one more thing :) the phpheader.php file seems to include alot of sensitive server info/pw...is this safe? i haven't a clue...im still trying to figure out how to use vbcodes :dead:
thanks again!
frank
Logician
06-22-2002, 06:38 PM
Originally posted by FrankR310
yea i decided to do just that..reply and then use summary tags...only VERY minor issue i noticed with this is that if the thread is more than 1 page..and i reply and the reply is on the "nth" page..then the homepage link is to my reply rather than the first page of the thread...even if i use the linkme tag...i guess this way is more flexible for the news poster.
yep I know this but couldnt find a better solution. In many cases you would like the original thread to be noticed (like when you use summary tags) so directly going to tagged message could be awkard. So I designed it that way. Intentional behaviour.
post A originated without news tags in post - news poster 1
news poster 2 adds news tags to post A
post A does not get dragged to news page
It should be. As I said the hack is not interested in the editor of the message. It checks 2 things:
* Does the post have news tags?
* Does the post owner has rights to use these tags?
So please double check the post owner (not the one who edited) is granted news posting priviliges in the options part. And make sure other restrictions do not apply to that post. Say if you set to have 5 news in your main page and if it is 6th, it may not be dragged. (Edit: Also check caps of the name. For example if the user's name in db is FRANK and if you configured it in the options as Frank, it wont work)
I dont think there is bug here but if you are sure, please let me know and I'll check.
OH i just remembered one other thing i wanted to ask you! the message at the bottom of the page that says "Time to compile news .xxx secs" i have run time set to "0" but it is still showing the message.
Congratulations you catched a bug! :) How come nobody warned me before, surprising! I'll release the fix asap.
the phpheader.php file seems to include alot of sensitive server info/pw...is this safe? i haven't a clue...
Since it's a PHP file, yep it's safe no worry. It's not possible to read/download a PHP file content, because server always parses it, if it's called. You can just try by calling it from your browser. You'll see it wont work.
Besides it's not the only sensitive .php file in your server. Check yourboard/admin/config.php. ;)
Logician
Logician
06-22-2002, 06:52 PM
MINOR BUG FIX
Here is a small bug fix. Please fix it if you installed the hack prior to the date of this message. The option to enable/disable news compilation time does not work (always on) if you dont fix it. (minor issue). After the fix you will be able to disable its display by setting the variable to 0. Thx to frank for reporting this.
Edit phpheader.php, find:
## Script Run Time
## if 1, script will post compile time with every news load like "This page has been compiled in 0.3433434 seconds"
## 0 disables this feature
$run_time=0;
(it can be set to 0 or 1 according to your configuration)
Replace it as
## Script Run Time
## if 1, script will post compile time with every news load like "This page has been compiled in 0.3433434 seconds"
## 0 disables this feature
$run_time_config=0;
(Again set it to 1 or 0 according to your wish.)
Edit newsconfig.php
find:
global $servername, $dbusername, $dbpassword, $dbname, $timeset, $forumlocation, $newstablesample, $normalcolor, $stickycolor, $staticlink, $readalltext, $readresttext, $linebreak, $remove_news_tag, $count_increase, $news_char_number, $max_news, $news_forums, $news_posters, $lang,$run_time, $installed_as;
Replace it as:
global $servername, $dbusername, $dbpassword, $dbname, $timeset, $forumlocation, $newstablesample, $normalcolor, $stickycolor, $staticlink, $readalltext, $readresttext, $linebreak, $remove_news_tag, $count_increase, $news_char_number, $max_news, $news_forums, $news_posters, $lang,$run_time_config, $installed_as;
and find:
if ($run_time)
Replace it as:
if ($run_time_config)
Logician
FrankR310
06-22-2002, 08:46 PM
$run_time = (string)substr(($time_end - $time_start),0,6);
i noticed this line above the if {$run_time} line
do i have to change that line to $run_time_config={string....?
nevermind, the fix got rid of the message! THANK YOU! :)
frank
ps i am using vb 2.2.6 and the hack is working fine for me.
Logician
06-22-2002, 09:00 PM
Originally posted by FrankR310
do i have to change that line to $run_time_config={string....?
$run_time variable keeps the running time of the script while our new $run_time_config variable keeps the option if this will be displayed or not. So do NOT touch that line. The line I mentioned in the bugfix message is the only line that should be changed (as you have already noticed) :)
Highlander
06-22-2002, 10:00 PM
hi..logician..again i tried your third hack..and i like it again..but enough of that ..you hear that so many times..but its your great work..you handle codes like i drink water on hot days..lol..
ok..i got no bugs to report..only wishes..like every time i meet you..here..
please follow this link to see what i mean:
<a href="http://www.spieleplanet.net/news/index.php">http://www.spieleplanet.net/news/index.php</a>
there you see my old news system....its similar like yours..but not integrated in the board..its a standalone script....but what i liked there is that i could handle different categories ..cause i got english users and german users..and for every head line there was an quick link schown on the top..so all headlines are shown on the top and seen at once..,got an idea how to handle this ?..and the next thing is....to display old news on NEXT PAGES or something like this..
so another question and this is what i need to know really ..how can i make the news system like you showed on teh news pages on the beginning of this thread..(examples) ..i want to make news from FORUM ID XX in the middle....and other news Forums should be shown in side boxes..what about that..its possible to make categories like center BOx (big in the center of the page with main news..and SIDE BOXES with short news on the right or left ?..i have to define specific Forum ids for that..but i dont see any option..for example Forum ID 50 will be shown only in the side boxes ..and ForumID 10 will be shown in the center as main news..understand my idea ?
you just win the football gemae today .. gratulation !
Highlander
06-23-2002, 06:55 AM
ups the URL is wrong :
http://www.spieleplanet.org/vbp/news/
Logician
06-23-2002, 10:43 AM
Highlander :Unfortunately your wishes are not achievable with this script. Script can not support different categories like English or German. However if you want, you can install it to 2 different directories and use one for English News and the other for German news. This is possible.
As for old news support, it's not possible. This is not designed to be a stand-alone news script but a vb-integration so it just drags vb news tagged messages to your main page and if a message is tagged as news but not dragged to the main page, script automatically removes the news tags from it (configurable in options part). This is intentional to decrease SQL load in your server and incease script running time and because of this behavior, it's not possible to save/archive/access old news.
Again you cannot create different columns for news, script is not designed to do that either. In my site's main page only the middle column is generated by this script, the other columns are not. So if you are referring the right column in that page, it's not this script doing it, I writed an individual PHP code to handle it.
Highlander
06-23-2002, 01:25 PM
okay..thx..i will dake the old news script for right side boxes....
but really it would be nice if we could define specific forums for specific teables..like FORUM1 and FORUM2 is with link or without link..so maybe it would be nice to make FORUM3 and Forum4 to define two Forum IDS for specific news .. this script is integrated in VB its the thing i searched..cause i need comments functions .. and so my news on main page and forum are the same..but for me only once written..
p.s. did you rite the seperate news script for the side boxes..could i try it maybe ´for extra news in side boxes like you got !
but really it would be nice to make a more dynamic news vb-script..with specific Forums to choosse wich are shown on the side in extra boxes..or somewhere else..maybe with other tags like news here inside
FrankR310
06-23-2002, 06:03 PM
i was thinking about how to do this as well....
couldnt i just rename one file like phpheader.php and phpheader1.php along with newsconfig.php and newsconfig1.php
then change reference to the correct file in the scripts and the news () function to news1 () function?
modify the template in phpheader
specify specific forums to pull news from for each one
then include them on the main news page?
i wanted to try this but didnt want to mess anything up as it's running so well right now...
what do you think? i have no zero knowledge on programming..just thinking things thru to see if it's possible.
thanks,
frank
futureal
06-23-2002, 06:22 PM
Quick question about this news script/hack: Is it possible to define a range of dates to display on a page (such as a site News page) with this?
In other words, suppose I want my site's home page to display all news messages newer than one month ago. Then I have another page (say, Archive) that will display all news posts for May, one for all on April, one for all of March, etc.
Would that work? I read through the documentation and either didn't see that info, or totally missed it. If it's the latter, I apologize.
Logician
06-23-2002, 06:59 PM
@Frank: All you suggested may be done but it will be pointless because both scripts (newsconfig.php and newsconfig1.php) will compile the same data from the database so although you achieve to have two news columns in one page, the compiled news will be same.
To seperate the news you need to go on hacking the script and modify the news tags too. [edit: just noticed you planned to seperate forums to post news, so you can skip this step]
So it requires a lot of work but it is possible, at least in theory.
@futureal: This script is degisned to pull messages only if they are tagged as news in the original post. So if you are referring a system that the script will automatically pull the news according to post date without author's tagging them, no it's not possible. You need to insert [news] tag to pull a message to your main page and delete the tag to remove it. The script automatically deletes the tag in certain cases too but message date is not one of them.
What you want to achive can be done via the new version of my WebTemplates hack though. (Recent beta version doesnt support this feature yet). Or you may want to check other news scripts released here. I dont know if any of them support what you asked but there are nice scripts around so you can find one with that feature.
Highlander
06-26-2002, 09:52 AM
Hi @all
I think i found a little bug..its not a really a bug ..but for all vbulletin owners wich got the FADE hack the news tag will make your posts fading (glowing) like links...i tried to manage this..but the fading hack sees in the news TAGS the same like [url] so the message is glowing...fading..
but only in the Forum..and i thought..maybe its not so bad..so the people see at once..thats news !
inetd
07-23-2002, 07:31 PM
Logician, this hack can work with WebTemplates?
Logician
07-23-2002, 07:48 PM
Originally posted by inetd
Logician, this hack can work with WebTemplates?
nope inetd, you cant integrate this script into a webtemplate. However you can create a webquery inside your webtemplate which derives news from your vb db. Of course news compiling features of a webquery will not be as advanced as Logician News script, but can do the trick, if you dont have so high expectations.
Ryangel
07-25-2002, 01:21 AM
using 2.2.6
Everything works fine :)
except that the text that i tag with
when i go back to view the thread, it doesnt disply.. as though it disappeared.
I will recheck code now. Just wondering if anyone had the same experiance or know a solution.
Ryangel
07-25-2002, 02:13 AM
ok I added {param} in all the right places in the new vbcodes and it worked!
Did i get a bad .html install file? cuz i found it strange.
Logician
07-25-2002, 05:59 AM
Originally posted by Ryangel
except that the text that i tag with
when i go back to view the thread, it doesnt disply.. as though it disappeared.
lol Ryangel but this is the default behaviour of the hack. :glasses: As mentioned in the instructions ALL hack tags (ie. [news] [summary] [intro] [options]) are INVISIBLE in the original thread.
[news] tag only tags your message as a news to notify the hack and helps you to choose a custom news title for your message. It doesnt have any other usage (especially in the thread) so I dont get why you want to make it visible?
Ryangel
07-25-2002, 06:02 AM
Ohhhhhhhhhhhh.
How silly of me. *whacks self*
:cross-eyed:
Ryangel
07-25-2002, 06:17 AM
Thanks for the clearification logician!
and again, great addon! :)
Is it posible to link from the news (read more...) to the orginal posting and not only to the thread. I think it is not so easy to find the right message if there are many messages in an thread.
Must be something in this line:
$news[$i][link]='[<a href="'.$forumlocation."showthread.php?threadid=".$news[$i][threadid]."&postid=".$news[$i][postid].'">'.$readresttext.'</a>]';
Thanks Michael
Logician
08-21-2002, 07:33 AM
Originally posted by miho
Is it posible to link from the news (read more...) to the orginal posting and not only to the thread.
Isnt it already so?
No, not in vb version 2.2.3.
Logician
08-21-2002, 05:31 PM
Originally posted by miho
No, not in vb version 2.2.3.
Did I get you right:
When [summary] or [intro] tags are used in a news message you want "Read More" link to link the news message itself which [news] tag is used, not the thread itself? If it is so, this is already the default hack behaviour and it's not related to the vb version you are using.
If this is not working for you, you mignt be designed your news HTML ($newstablesample) incorrectly in "phpheader.php" file in options. You need to use ??NEWSLINK?? variable for this link.
If you can post your $newstablesample and the link of your webpage which is not working correctly, I can help more..
Excuse me, may be i did not express everything right (I,m German).
I tried it on your Homepage.
http://www.turkhukuksitesi.com/hukukforum/showthread.php?threadid=1593&postid=5459
This link under the news on your frontpage brings me to the first post in the thread, not to the post number 5459.
Logician
08-23-2002, 09:24 AM
Originally posted by miho
I tried it on your Homepage.
http://www.turkhukuksitesi.com/hukukforum/showthread.php?threadid=1593&postid=5459
This link under the news on your frontpage brings me to the first post in the thread, not to the post number 5459.
ok you are correct and congrats you caught a small bug which has gone unnoticed for months.. :)
The fix is:
Replace:
$news[$i][link]='[<a href="'.$forumlocation."showthread.php?threadid=".$news[$i][threadid]."&postid=".$news[$i][postid].'">'.$readresttext.'</a>]';
AS:
$news[$i][link]='[<a href="'.$forumlocation."showthread.php?postid=".$news[$i][postid]."#post".$news[$i][postid].'">'.$readresttext.'</a>]';
Thx for bringing this to my attention..
DeadMan384AD
08-24-2002, 11:02 PM
Wow great script!
Unfortunatly, for some reason It isnt parsing the code for when people use the quote tag.
The instructions say to look for:
$postdate=vbdate($dateformat,$postinfo[dateline]);
$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=htmlspecialchars($postinfo[pagetext]);
but the closest I found was :
$postdate=vbdate($dateformat,$postinfo[dateline]);
$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=$postinfo[pagetext];
It should be near the top of the file right? I'm still pretty new at installing hacks. This isnt a huge problem, cause I have it limited to only a few people to post news, but its messy and I'm sure people will ask about. and then put all the uneeded tags in there...
Also, I cant get
??STATICLINK??
to work... and we like to post the full news post on the main page, rather than having a summary.
Otherwise it was a great script! Exactly what I was looking for!
edit- Forgot to mention I'm using vB 2.2.6
Logician
08-25-2002, 10:59 AM
Originally posted by DeadMan384AD
Wow great script!
Unfortunatly, for some reason It isnt parsing the code for when people use the quote tag.
The instructions say to look for:
$postdate=vbdate($dateformat,$postinfo[dateline]);
$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=htmlspecialchars($postinfo[pagetext]);
but the closest I found was :
$postdate=vbdate($dateformat,$postinfo[dateline]);
$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=$postinfo[pagetext];
It should be near the top of the file right? I'm still pretty new at installing hacks. This isnt a huge problem, cause I have it limited to only a few people to post news, but its messy and I'm sure people will ask about. and then put all the uneeded tags in there...
Do you you mean "parsing the qoute tag" in news or "deleting the news tags when a news message is quoted by another member"? (Installation Step 4)
If it's the latter you are right. Seems that vb 2.2.6 made some small code changes but where you referred is correct. Just apply the code after that part and you should be fine (this is for "deleting the news tags when a news message is quoted by another member")
Also, I cant get
??STATICLINK??
to work...
What happens when you use it?
and we like to post the full news post on the main page, rather than having a summary.
It's upto you, dont use summary tags then..;)
If you use only Title of your news tags in a message, all post will be moved to your news page..
Regards,
DeadMan384AD
08-26-2002, 02:50 AM
Yup, putting the Step 4 after rather than before worked. Thanks
Like it says, the newslink doesnt appear if only the news tag is used.
but the staticlink tag turns out as:
Logician
08-26-2002, 07:19 AM
Originally posted by DeadMan384AD
Like it says, the newslink doesnt appear if only the news tag is used.
but the staticlink tag turns out as:
ok got you.. Edit phpheader.php, find:
$readresttext="Read All->>";
after that add:
$staticlink="Go to Post->>";
And it will work as you wished..
DeadMan384AD
08-26-2002, 11:19 PM
Excellent... Thanks man!
Once again, great hack!
zonegray
09-09-2002, 01:51 PM
What are the limits on the $news_posters array? I might have 30-50 users that I'd want to enable this for.
Great add-on, BTW.
Logician
09-10-2002, 07:21 AM
Originally posted by zonegray
What are the limits on the $news_posters array? I might have 30-50 users that I'd want to enable this for.
Go ahead and add them.. Since the array values are hard-coded inside the code, adding a lot of members does not effect the performance..
DeadMan384AD
09-10-2002, 11:36 PM
I finally have this available to the public on my site... and it looks great! Works great too! :D I just need to get it so smilies work, but I think you mentioned it in this thread already, if not... :D
Logician
09-11-2002, 07:05 AM
Originally posted by DeadMan384AD
I finally have this available to the public on my site... and it looks great! Works great too! :D I just need to get it so smilies work, but I think you mentioned it in this thread already, if not... :D
The hack automatically parses smilies :)
zonegray
09-11-2002, 11:35 AM
Go ahead and add them..
Thanks. Seems like I should be able to modify the script so that it simply checks if the poster is a member of a certian group. Any special reason you didn't do it this way?
Also, when I post a news item, the output contains a tag <a name="a"> where the first intro tag was. So, when I browse in Mozilla, the whole paragraph lights up with the "hover" color when I pass the mouse over it. Anybody else notice this?
That tag is in the regular message post, BTW, not the front page text.
Logician
09-11-2002, 12:55 PM
Originally posted by zonegray
Thanks. Seems like I should be able to modify the script so that it simply checks if the poster is a member of a certian group. Any special reason you didn't do it this way?
Yes there is a reason:
The hack is coded to be a site main page script which means that it will be accessed very heavily everyday. So as to keep its performance high, I wanted to get rid of every possible SQL connection the script will make so hardcoding many things inside the code helps the code not to query your database for these information.
If I programmed it to check usergroups to decide if user is a legitimate news poster, the script will make an extra SQL connection for every news message you have in your main page. Because post table does not save usergroup of message poster but only its userid/username so we should query the user table for every news poster to decide if he is from an allowed user group. If you have 10 news in your main page, this would mean the script would make 10 more SQL queries to your board which IMO too much for a main page script.
So I dont suggest modifying the script to work with usergroups.
But if you are determined here is a work-around for you: Instead of restricting user names, restrict news forums in the settings so that news can only be posted in forum X. Also loose the poster info and let EVERYONE can post news in the scripts settings. Then all you need to do is to restrict this forum's permissions to other usergroups than your special one via vb ADmin CP. So with this trick you can make only that usergroup can post news in the main page.. ;)
Also, when I post a news item, the output contains a tag where the first intro tag was. So, when I browse in Mozilla, the whole paragraph lights up with the "hover" color when I pass the mouse over it. Anybody else notice this? That tag is in the regular message post, BTW, not the front page text.
Oh I see.. it's a trivial issue related to the bb tag of intro we created inside Admin CP. You can change it to something like <b></b> or any other non-posting HTML code to correct the issue..
Abbas
09-11-2002, 07:06 PM
Zonegray - The way I do news posting on my forum, is have an actual 'news' forum that contains only news items for the front page. We then make our news posters into moderators for this 'news' forum and make it so that only moderators can post new threads. That way, only the news posters (moderators) can start new threads but everyone can reply to the news. This is similar to other sites where you can see the news on the frontpage and it also says something like '5 replies' or '5 comments'
Logician
09-12-2002, 05:37 AM
Originally posted by Abbas
Zonegray - The way I do news posting on my forum, is have an actual 'news' forum that contains only news items for the front page. We then make our news posters into moderators for this 'news' forum and make it so that only moderators can post new threads. That way, only the news posters (moderators) can start new threads but everyone can reply to the news. This is similar to other sites where you can see the news on the frontpage and it also says something like '5 replies' or '5 comments'
If you are using my script for this and didnt restrict news posters in settings, I want to remind you that your users can still post news to your main page. Since the script does not care if news message is a thread starter or a reply, if you dont restrict news poster names, your users using news tag in the reply messages in that specific forum will be able to move their posts to your main page.. ;)
However they wouldnt know how to drag a message to the main page, so we can still say that you are safe (provided that you installed the tag remover step in installation instructions)
Abbas
09-12-2002, 07:23 AM
hehe, actually I'm not using your script just yet (but hoping to soon when I give my forums a huge overhaul), I'm using one of the other news posting scripts, which just takes the first post from each thread.
Hmm... maybe you should make it so that your hack only takes the first post??? I mean when would you want a reply to become a separate post item? Seems unlikely in my opinion.
Logician
09-12-2002, 07:39 AM
Originally posted by Abbas
hehe, actually I'm not using your script just yet (but hoping to soon when I give my forums a huge overhaul), I'm using one of the other news posting scripts, which just takes the first post from each thread.
Hmm... maybe you should make it so that your hack only takes the first post??? I mean when would you want a reply to become a separate post item? Seems unlikely in my opinion.
If my hack would only take the first post as news, then why would I program it and why would the hack users use it? Other news scripts also do this.. ;) This is (and some other features) that makes my script different than others.
BTW. I dont agree it's unlikely to drag a non-first message as news. If you use tags it can be very useful to drag them. For example say you have a hot thread in forum X and you want to notify main page visitors about this thread. In your board you have to go and make a news thread in your specific forum. But in my board I can just click reply in that hot thread and write this:
Hey I dont agree you!
Come Join Discussion
[summary]We are discussing if Logician's News should drag non-first posts to main page or not. click hereto join!
Now all thread viewers will see only the message:
Hey I dont agree you!
in the thread and wouldnt even notice this post was a news, but in your main page a news will appear as:
We are discussing if Logician's News should drag non-first posts to main page or not. click here (http://www.here.com) to join!
See the difference? ;)
zonegray
09-13-2002, 11:53 AM
Thanks for the replies. Seems we could probably run one SQL query at the beginning of the script that would list the users in certain groups, and then just fill the array with the list. But, I think we have other more pressing hacks to do (we're still setting up)., so that will go on the "someday" list. If we eventually ended up with 5-6 hacks that required manual maintenace, it would be a pain, but we can deal with one for now. This hack works so well for us, since it distributes the load of maintaining the front page, meaning nobody has to be "on duty" when the news comes pouring in.
I hadn't noticed that it was possible to enable all users to post news... so we might take the approach Abbas suggested, at least to start; we'll just disable replies in the news sections. But... does anybody know of a hack that will redirect replies to a different section or something similar? The idea is to give users a "Comment" link, but one that takes them somewhere else.
zonegray
09-30-2002, 12:29 PM
Just wondering... it seems I should be able to intergrate this with WebTemplates this way:
- make a copy of show.php (which would be called for pages that required news), assume it's called shownews.php.
- edit shownews.php and require/include newconfig.php
- assign output of news() to a variable, eg $newsoutput=news()
- use variable in a WebTemplate.
Obviously, I'd want to keep track of the number of queries so it didn't bog down.
Logician
09-30-2002, 04:49 PM
Originally posted by zonegray
Just wondering... it seems I should be able to intergrate this with WebTemplates this way:
I didnt try this.. On theory it looks fine.. Please let me know if it worked..
zonegray
09-30-2002, 10:51 PM
Yup, it seems to work.
I just added this right below the global.php include in my copy of show.php:include("./newsconfig.php");
$newsoutput=news();And then inserted $newsoutput into a template. Obviously, the news adds extra overhead, so it seems wise to use a "clean" copy of show.php for most templates, and only use the modified copy for pages that need to include the news. I suppose you could include the news into just about any page this way, if there were a reason to.
Whee, this is going to work out great. Thanks for the great add-on.... it works exactly the way we need it to.
I am wondering if you know this hack to work with PostNuke or other CMS as a block?
Thank you,
Brew
TheJANG
11-15-2002, 06:29 AM
A+! This is a truly A+ add-on/hack and it's already saving me time. I've done a little modifying and inserted it in an iframe on my site at http://www.UltimateRC.com . I've got three more sites lined up & ready to use it!
Thank you VERY much for the great work. This looks like the simplest, easiest-to-use, most configurable news-from-vB-on-a-non-vB-page setup around.
*clicks INSTALL*
zonegray
11-17-2002, 05:45 PM
hmmm... the timestamp (??NEWSDATE??) seems to be coming up an hour earlier than the actual post. It reads 12:21 pm on the front page, and 1:21 pm in vBulletin. Can I fix it?
Looks like it has something to do with $gelentarih, but my Turkish is even worse than my PHP ;)
Logician
11-17-2002, 06:32 PM
Originally posted by zonegray
hmmm... the timestamp (??NEWSDATE??) seems to be coming up an hour earlier than the actual post. It reads 12:21 pm on the front page, and 1:21 pm in vBulletin. Can I fix it?
Looks like it has something to do with $gelentarih, but my Turkish is even worse than my PHP ;)
:classic:
it's in phpheader.php:
## Time difference between the time zone post you want for your news and your server(vbulletin) time.
## Set is as a positive or negative number such as -3, +5 etc.
$timeset=0;
Sebastian
11-17-2002, 08:07 PM
Logician, does this have an archive news page? basically I am looking for something like this but also a way to get old news from a forum and put them on a different page, sorted by month the news was posted. What happens when there are 30 articles posted? does it archive them?
Logician
11-17-2002, 09:40 PM
Originally posted by Sebastian
Logician, does this have an archive news page? basically I am looking for something like this but also a way to get old news from a forum and put them on a different page, sorted by month the news was posted. What happens when there are 30 articles posted? does it archive them?
Sebastian this hack does not have an archive feature.. It just pulls the tagged posts to your non-vb page and removes their "news status" when they expired according to your configuration. So it does not archieve old posts..
I have 250 000 posts and it's too slow for me :(
But seem to be workign good but slow :(
How much faster will the advance hack improve it?
I am hesitant to use it since it changes the database. Can the changes be resetted?
www.bmwm5.com
Logician
11-29-2002, 10:50 AM
Originally posted by GTGT
How much faster will the advance hack improve it?
I am hesitant to use it since it changes the database.
Advanced installation will cure the slowness dramatically. As a matter of fact it is for large databases like yours so dont hesitate to use it. Although my board is small, even I use the hack with advanced installation.
If you want to revert back your db to original values, you can do it via PhpMyadmin easily. The advanced installation adds a new field (news) to "post" table and adds an "index" to that field so that searching will be fast, that's it. If you want to remove it later, all you need to do is to delete this field from your table. It's no big deal, but you should always backup your database before every altering step anyway..This is a general rule..
Thanks for the answer. I am hesitant to change my database though. Hmmw, what eould you think of this hack:
#### Subject Preview by DR2000 ####
I looked at all other hack avaliable for this, and all of them are trying to do too much by editing your database structure, and modifying the way data is inserted. Why overcomplicate things, when all data is already there, and it only needs to be extracted...
#### DEMO ####
To see this hack in action take a look at http://forum.4adrive.com
#### FEATURES ####
- Shows the subject of the last active post on the front page
- Shows the icon of the last active post on the front page
- No need to alter database, and risk to screwing something up
- Only one file to change
- If the subject was very long, shows trunkated version of it, and replaces the rest with '...', preventing your main page layout from being screwed up.
#### #### ####
Nov 14, 2001
#### #### ####
Maybe it doesn't worh for vbulletin 2.2.9?
Logician
11-29-2002, 11:55 AM
Originally posted by GTGT
Thanks for the answer. I am hesitant to change my database though. Hmmw, what eould you think of this hack:
#### Subject Preview by DR2000 ####
I looked at all other hack avaliable for this, and all of them are trying to do too much by editing your database structure, and modifying the way data is inserted. Why overcomplicate things, when all data is already there, and it only needs to be extracted...
I don't know, I did not use it. If you are only pulling titles, etc. from your db, its explanation might be true, you can pull it from db. But my hack has advanced features like customizing the post while dragging, pulling only some part of it, marking a post as news instead of thread's first message etc. and it would require db alteration if your db is large.
OK. Ill see if I'll change the database. We'll see.
Is there a way to revert the database changes? Also will the search results be changed when you search?
Also how much faster will it be?
Logician
11-30-2002, 04:13 PM
Is there a way to revert the database changes?
Yes of course. To revert it you need to delete the "news" column in "post" table. Also don't forget to revert script modifications of the advanced installation or you'll get db errors when you send a news post.
Also will the search results be changed when you search?
Question is not clear to me. Neither the advanced installation, nor the hack itself has nothing to do with vb's searching feature. So what do you mean?
Also how much faster will it be?
I can not give you a maths formula but all I can say is this: it will be dramatically faster compared to basic installation considering the fact that you have a large db.
In basic installation when the scripts runs, it goes through the entire post table, checking all posts in your database and looks for the hack tags [news] in posts. Think about how long it will take if you have 100.000 posts with each 1000 characters in it.
When you apply advanced installation, hack will tag news posts in column news in database and the script will only check for the tagged messages and will not look inside the posts anymore. So the result will be returned very fast.
Hope this helps..
downsouthern
01-19-2003, 03:15 AM
For step 3, exactly where do we add the VB codes?
Logician
01-19-2003, 07:56 AM
Originally posted by downsouthern
For step 3, exactly where do we add the VB codes?
Admin CP/Custom vB Codes/Add
Trigunflame
01-29-2003, 02:40 AM
Um im staff on www.animega.net and were using the main news for that site, from a category at www.tokyoforums.com I changed the serverdomain from localhost to the ip number but it says this
Warning: Access denied for user: 'vbbforums@thunder8.cwihosting.com' (Using password: YES) in /home/animega/public_html/newsconfig.php on line 25
Warning: MySQL Connection Failed: Access denied for user: 'vbbforums@thunder8.cwihosting.com' (Using password: YES) in /home/animega/public_html/newsconfig.php on line 25
Couldnt find MYSQL!
any help? or imma have to go back to coranto
Logician
01-29-2003, 09:00 AM
Originally posted by Trigunflame
Um im staff on www.animega.net and were using the main news for that site, from a category at www.tokyoforums.com I changed the serverdomain from localhost to the ip number but it says this
Warning: Access denied for user: 'vbbforums@thunder8.cwihosting.com' (Using password: YES) in /home/animega/public_html/newsconfig.php on line 25
Warning: MySQL Connection Failed: Access denied for user: 'vbbforums@thunder8.cwihosting.com' (Using password: YES) in /home/animega/public_html/newsconfig.php on line 25
Couldnt find MYSQL!
As a matter of fact I didn't code the hack considering it will run remotely so don't know how it will behave in your situation. I dont think it will be a problem but I can not guarentee that either..
However your problems seems different now. Your error message indicates either one :
* username, password or IP address you entered is wrong
* Your MYSQL server you're trying to connect does not accept remote connections.
Latter is likely: Many hosting companies do not allow remote connections to their MYSQL servers so I suggest contacting them and make sure they have configured their servers to accept remote connections.. If they do they can discuss this problem with them too. Maybe they require a different username/password to connect remotely.
Upto this point your problem is not related to the hack itself. But even if you solve this problem, hack can create other problems about remote connection, I'm not sure about it.. :) Just give it a try anyway..
Tobad
01-31-2003, 10:34 PM
Is there anything that needs to be modified in your script in order for it to work on the new PHP version?
The script has been running flawlesly till today. My host (Powweb) updated the servers to PHP 4.3.0 and when you try to access my main page (where your script loads) it just sits there and never loads in.
When I remove the <?php echo news() ?> page loads fine, but of course the news doesn't show. This really sucks and worst case scenario I have to scramble to find something to work in the meantime.
Any help would be great. Site is http://www.chicagogamers.com. for now I removed the script but you can see it not working here: http://www.chicagogamers.com/index2.php
Logician
02-01-2003, 09:04 AM
Originally posted by Tobad
Is there anything that needs to be modified in your script in order for it to work on the new PHP version?
Any help would be great. Site is http://www.chicagogamers.com. for now I removed the script but you can see it not working here: http://www.chicagogamers.com/index2.php
index2.php gives a 404 and as far as I can see the script runs fine in your main page. I guess you figured out a solution?
VeoMorphine
02-01-2003, 05:54 PM
is there an edit i can make that lets certin usergroups use the tags insted of forum names? so insted of putting nick one i can put usergroup 6, 5 ,4
Logician
02-01-2003, 08:17 PM
Originally posted by VeoMorphine
is there an edit i can make that lets certin usergroups use the tags insted of forum names? so insted of putting nick one i can put usergroup 6, 5 ,4
Try this:
edit newsconfig.php find:
select postid, threadid, username, userid, dateline, title, pagetext, iconid
from post WHERE
visible= '1' $SQLposters AND (pagetext LIKE '%%' OR pagetext LIKE '%%')AND (pagetext LIKE '%%' OR pagetext LIKE '%%') order by dateline DESC LIMIT 500
Replace it as
SELECT p.postid, p.threadid, p.username, p.userid, p.dateline, p.title, p.pagetext, p.iconid, u.usergroupid FROM post p LEFT JOIN user u ON u.userid = p.userid WHERE ( u.usergroupid = 6 OR u.usergroupid = 5 OR u.usergroupid = 7 ) AND visible = '1' AND ( pagetext LIKE '%%' OR pagetext LIKE '%%' ) AND ( pagetext LIKE '%%' OR pagetext LIKE '%%' ) ORDER BY dateline DESC LIMIT 500
Also find:
select postid, threadid, username, userid, dateline, title, pagetext, iconid, news
from post WHERE
news='1' AND (visible= '1' $SQLposters AND (pagetext LIKE '%%' OR pagetext LIKE '%%')AND (pagetext LIKE '%%' OR pagetext LIKE '%%') ) order by dateline DESC LIMIT 500
And replace it as:
SELECT p.postid, p.threadid, p.username, p.userid, p.dateline, p.title, p.pagetext, p.iconid, u.usergroupid,p.news FROM post p LEFT JOIN user u ON u.userid = p.userid WHERE news='1' AND (( u.usergroupid = 6 OR u.usergroupid = 5 OR u.usergroupid = 7 ) AND visible = '1' AND ( pagetext LIKE '%%' OR pagetext LIKE '%%' ) AND ( pagetext LIKE '%%' OR pagetext LIKE '%%' )) ORDER BY dateline DESC LIMIT 500
This is not tested but should work.. However please notice that this can increase query return time to a certain extend (especially in large dbs) as to query usergroupid we need to connect our SQL query to user table too. I can't say anything how much it will effect. You can turn on $run_time_config variable and test yourself.. For small databases it will not be a big deal anyway..
Enjoy.
Tobad
02-02-2003, 04:46 PM
Yes I got it working, sorry didn't have time to post back. All I had to do was to update the path in the first line in the index.php.
From:
<?php include ('newsconfig.php');?>
To:
<?php include ('/www/t/tobad/htdocs/newsconfig.php');?>
I guess this is something new with the new version of PHP. It needs the full path.
Thanks for looking at it though.
hi
has anybody of you a german version of this news addon ???
thankz
cuba
hi logician
i've just installed your news hack, i think i have a problem with the vbcode...i've attached a printscreen...and in my index.php i get the message: no news at the moment !?!?
what's wrong?
best regards
cuba
@ logician
i got a problem with your hack: when i test the news vbcode in my admin cp it doesn't display a text (news) i got stripes ???
and on my index.php the message: "no news at the moment" appears !
what's wrong ???
thanks in advance for your kind help ! is it perhaps a language problem, i live in switzerland, my board is in german !?!?
regards
cuba
Logician
02-12-2003, 06:36 PM
and on my index.php the message: "no news at the moment" appears !
what's wrong ???
Have you marked any post as news by inserting Title of the news tag in it?
If yes, also check the options you set in the phpheader.php file. For instance if you set $news_forums or $news_posters variables in the options, your news forum or news poster should comply with this..
DaPro
02-13-2003, 07:45 PM
Hi Logician, I am a new b so I just wanted to know this:
I plan on using this script as a commenter more than a news script because I think this can work, but the problem I have is that I have different pages with different topics to comment on, so I was wondering is it possible to make certian comments go into pages? SOrry if this has been asked before, but I just wanted to know if this is possible without having to add this hack over and over. Thanks Lovely Hack!
Logician
02-14-2003, 09:58 AM
Originally posted by DaPro
Hi Logician, I am a new b so I just wanted to know this:
I plan on using this script as a commenter more than a news script because I think this can work, but the problem I have is that I have different pages with different topics to comment on, so I was wondering is it possible to make certian comments go into pages? SOrry if this has been asked before, but I just wanted to know if this is possible without having to add this hack over and over. Thanks Lovely Hack!
If I understand you correctly, nope sorry, it's not possible with this hack..
gopherhockey
02-18-2003, 01:15 AM
I have a few non-vb hacks installed on our index.shtml file - last 10, recent images (from photopost) - this hack would be nice.. however, I cannot rename my index file to a .php extension as it ruins the other hacks.
Is there a way to run it under an index.shtml file?
I read the threads quickly and didn't see anything like this, which surprises me.
Thanks.
Logician
02-18-2003, 07:43 AM
Originally posted by gopherhockey
I have a few non-vb hacks installed on our index.shtml file - last 10, recent images (from photopost) - this hack would be nice.. however, I cannot rename my index file to a .php extension as it ruins the other hacks.
Is there a way to run it under an index.shtml file?
I read the threads quickly and didn't see anything like this, which surprises me.
Since the script is in php, technically its extension is suppose to be .php. However using the same method your other hacks uses might work with my hack too (provided that they are in PHP too):
First create a second PHP file with a name like this: "secondindex.php" and use this as its context:
<?php
include ("newsconfig.php");
echo news();
?>
Now you can include this new file in your shtml file as an include like you added your other hacks. Eg.
<!--#include virtual="/secondindex.php" -->
Whether this works or not, I still suggest migrating your index.shtml file to index.php in the long run. Because:
a) If you are on PHP, this is the default syntax and it may help you better in the future with other PHP add-ons.
b) This approach increases server load unnecerrarily. Your file is parsed twice (as PHP and shtml) while only 1 parsing would do the trick if it as .php..
gopherhockey
02-18-2003, 07:56 PM
Wow, worked perfectly!
I have a huge debate going on right now (in my head mainly) as I am working to combine a message forum site with 2 other very large related static web sites (.html based only - users requiring front page to modify)
If I switch to .php, I lose frontpage abilities and editing the look of a page becomes a huge pain.. yet inserting code such as this hack works much better. If I switch pages to .shtml as needed I lose out on the things you mentioned.
So far I have about 6-7 nice hacks for my main .shtml page including your news, a calendar, poll, recent gallery images from photopost, user login, recent forum posts ... it is almost looking like a product like vbhome lite, yet retains its original web site look and frontpage capabilities. (not that I'm a huge fan myself of fp) The good thing is that the audience is local and the server is high powered, so I fan afford some amount of overhead until we find a better way.
Thanks for your help!
Logician
02-18-2003, 08:18 PM
Originally posted by gopherhockey
If I switch to .php, I lose frontpage abilities and editing the look of a page becomes a huge pain..
Do you know that you can safely rename a .html page as .php and the page will work just like it was .html? (But you can now open a php tag in any place of this page and insert php codes). So migrating your .html files to PHP should not be a problem except editing their content and correct the link pointers.
Well this might not apply for .shtml though. You have to deal with its includes too..
Jethro
02-26-2003, 02:30 AM
Logician you da man :bandit: w00t 1/2 am hour from reading the first instruction to having the first news item posted up on our test board :smoke:
Just one minor problem (and is probably sitting in the html code somewhere), how do we cut out the gap between news items ?
Figure there must be a <br> tag lurking in there somewhere.
FYI this one works perfectly on 2.3.0.
Do we get to vote for hack of the month? If we do this get's my vote, big up respect to Logician.
Thanks Man.
Will post up url of it working when we get our home pages uploaded (still working on them) :)
Logician
02-26-2003, 12:48 PM
Originally posted by Jethro
Figure there must be a <br> tag lurking in there somewhere.
You can customize the news look by modifying the "$newstablesample" variable in phpheader.php..
And the <br> is at the end of this part.. ;)
Jethro
02-26-2003, 06:52 PM
Excellent ! Thanks once again Logician :thumb:
Jethro
03-02-2003, 03:03 AM
Okay this one is installed live. Thanks Logician, very easy to install and use (once you remember to add the tags into the Admin CP) :speechless:
See attached for our first news item ....
Malice
03-10-2003, 07:23 PM
I got a problem...
Of course it may be me...
I will exaplain and someone here can possibly clear this up for me.
In a new item.
I post this:
This is a news item
THis is an intro, blah blah blah...
The rest of the news item....
When I view the message (edit it again) the NEWS tags and the text within it is gone.
Am I lost here...am I missing some functionality here..?
Malice
03-11-2003, 10:45 AM
Anyone have a thought about this one?
This problem keeps happening over and over, and the news from the front page then disappears....
Logician
03-12-2003, 10:38 AM
Originally posted by Malice
I got a problem...
Of course it may be me...
I will exaplain and someone here can possibly clear this up for me.
In a new item.
I post this:
This is a news item
THis is an intro, blah blah blah...
The rest of the news item....
When I view the message (edit it again) the NEWS tags and the text within it is gone.
Am I lost here...am I missing some functionality here..?
If I understood correctly, when you post news, it is first ok, until you edit it. Then it dissapears, is this correct?
It seems that there is something wrong with Installation STEP 2, 3 or 4. Please check these steps are applied correctly..
gmarik
05-27-2003, 05:02 AM
Logician only one remark: please change the design of http://www.turkhukuksitesi.com/, if you need help - I could help you ... :o)
Logician
05-27-2003, 05:47 AM
Today at 09:02 AM gmarik said this in Post #121 (https://vborg.vbsupport.ru/showthread.php?postid=400462#post400462)
Logician only one remark: please change the design of http://www.turkhukuksitesi.com/, if you need help - I could help you ... :o)
hehe in my to do list for months but well my to-do list is long and I'm tight in time. But it is no big deal, it is kind a "private" site, membership requires approval, members do value functionality and content, not the visual look, so do I.. ;)
Mr. Brian
06-06-2003, 09:40 PM
Seem i'm quite a bit outdated, till now then I know got such hack from you.
Too bad as I already got vbHome (lite) installed..
anyway, it's still a nice one.
austinspace
06-07-2003, 02:16 AM
The link to the download is broken.
From:
vBulletin.org Forum > Hacks Database > Major Additions > Logician NEWS: Drag Any Message to Your Main Page
I'm interested in seeing if this add-on will allow me to send a new post in
certain forums to an email address automagically.
Mark
Hobbes
07-20-2003, 02:06 AM
well...
I have two suggestions for add-ons.
One, is the ability to add a picture to the news, so when you post you can make a tab like http://www.blah.com/image.gif and that image will not be displayed on the forum post, but it will be displayed on the main page where the news is (some new variable can do that)
The other is the ability to make it optional to put each news post into a category, so for example, if I wanted to sort my news by console, I could stick a tag like PS2. Then you can be able to show only news from each category, or you can show all news.
srry if that dun make sense...hehe
soccerclue
07-20-2003, 02:13 AM
May I know what's the difference between this hack and vbLite? I also installed vbWebtemplate also..and I think the combination of vbWebtemplate and this hack can do what vbLite does? Correct me if I am wrong.
Is it possible to drag only certain messages in the main page? Or can it be possible to drag the latest 5 posts? Can this be hack be integrated with Webtemplate?
If can, I might consider to install this one also.
Logician
07-20-2003, 07:53 AM
Today at 06:13 AM soccerclue said this in Post #126 (https://vborg.vbsupport.ru/showthread.php?postid=419111#post419111)
May I know what's the difference between this hack and vbLite? I also installed vbWebtemplate also..and I think the combination of vbWebtemplate and this hack can do what vbLite does? Correct me if I am wrong.
vblite is a portal that replaces your site home page. This hack is a news script that only compiles posts from your DB that you marked as news. You can use that compiled news in your homepage or in another page. This hack does not have any other features. But vblite has other add-ons for your home page like calendar, show post count etc.
Webtemplates hack can be used together with this hack only if you are using them in different pages. Say you can have this hack drag news to your main page and use webtemplates in other site pages. But they can not be in the same page.
Is it possible to drag only certain messages in the main page? Or can it be possible to drag the latest 5 posts?
If you want to drag latest X posts as news, try others news hacks, all can do it.
This is different because this will allow you to drag any message from any boards. You just need to mark it as news and it apprears in your home page.
Solice
07-20-2003, 04:19 PM
I hate to post this here...
well first off, thank you for making such great add-ons logician... im currently setting up forums with your webtemplates add-on and its excellent... but anyway...
I set this up according to the directions, I've tried making a couple of news test posts... but nothing shows up on the main page...
www.solicenet.com/index2.php - main page, theres a lot of php lines in it, I don't know if maybe thats interfeering with the script?
www.solicenet.com/main/ - forums
If anyone could assist me with this, it would be greatly appreciated.
Logician
07-20-2003, 05:04 PM
Today at 08:19 PM Solice said this in Post #128 (https://vborg.vbsupport.ru/showthread.php?postid=419239#post419239)
I hate to post this here...
well first off, thank you for making such great add-ons logician... im currently setting up forums with your webtemplates add-on and its excellent... but anyway...
I set this up according to the directions, I've tried making a couple of news test posts... but nothing shows up on the main page...
www.solicenet.com/index2.php - main page, theres a lot of php lines in it, I don't know if maybe thats interfeering with the script?
www.solicenet.com/main/ - forums
If anyone could assist me with this, it would be greatly appreciated.
1- Check you installed the hack correctly
2- Make sure you marked a post as news correctly eg. This is a News Title
3- Make sure configurations in options file does not clash with your news. For instance if you set a forum id for news, you can not post news in a different forum. Check phpheader.php file carefully.
Solice
07-20-2003, 05:12 PM
1 - checked
2 - checked
3 - checked
I've looked at everything twice and I can't figure out whats wrong :(
Logician
07-20-2003, 05:29 PM
it is the post itself that should include tag This is a News Title not its title, you are aware of this right?
Solice
07-20-2003, 05:31 PM
yea, i made one post with it in the post and one with it in the subject...
Logician
07-20-2003, 05:35 PM
well I'm not sure how I can help you more. This hack is an old one so tested for a long time by different users. Thus I believe that it should be something related to you, not the hack itself. But if you think that it is a hack bug and want me to debug, I can do it if I'm granted admin access/FTP access/PHPmyadmin access to your server.
Solice
07-20-2003, 05:47 PM
Well it may be my server or something, but if you would be willing to debug, i think it would be worth the try and I can give you temporary access, do you have ICQ, AIM, MSN or Yahoo?
Logician
07-20-2003, 05:55 PM
please send access details via email or PM
Logician
07-20-2003, 06:30 PM
1 - checked
2 - checked
3 - checked
I've looked at everything twice and I can't figure out whats wrong
it is working ok.
Your mistakes were:
1- I couldnt find news title tag in any of your messages. When I added one, it is dragged to the main page.
2- You didnt configure $news_posters variable in the options file correctly. You have to enter news posters USERNAMEs there to authorize them access. I added your username (Stellice) and it is all ok now..
You can remove my access to your board.
SVTBlackLight01
07-21-2003, 06:47 PM
Great hack!
I got this to display on my home page fine. The only thing is that for some reason it underlines the posts I'm pulling from. I'm using and
An example can be seen here (http://www.modernengineuity.com/forums/showthread.php?s=&postid=377#post377).
test page (http://www.modernengineuity.com/new.html)
I've gone over everything and can't seem to find what might be causing it.
Logician
07-21-2003, 08:27 PM
Try to change these 2 vbcodes like this and lets see if it will work
vB Code tag: news
vB Code replacement: & nbsp;
vB Code tag: intro
vB Code replacement: & nbsp;{param}
(Remove space between & and nbsp; )
SVTBlackLight01
07-21-2003, 10:26 PM
Great!! That fixed it!
--> clicks install :D
soccerclue
08-11-2003, 11:59 PM
I would like to know if we drag a post to the main page, can we add picture for that post in the main page or do we need to edit the post and add the picture in order to have the picture displayed in the main page? I would like to install this one if it can have picture in it.
SVTBlackLight01
08-14-2003, 04:10 AM
08-12-03 at 01:59 AM soccerclue said this in Post #140 (https://vborg.vbsupport.ru/showthread.php?postid=425302#post425302)
I would like to know if we drag a post to the main page, can we add picture for that post in the main page or do we need to edit the post and add the picture in order to have the picture displayed in the main page? I would like to install this one if it can have picture in it.
I would be interested in this as well.
soccerclue
08-14-2003, 05:00 AM
SVTBlackLight01, I visited your forum and saw that you got a great forum and the nice news in front page with picture. Are you attaching the picture manually using HTML editor? Is the news using this hack?
SVTBlackLight01
08-14-2003, 05:16 AM
Yes, the news section on the front page is manually edited. I had switched to this hack for a while because I liked having the views, posts etc. I wanted to have the pictures, though so I switched back to what I have now.
soccerclue
08-14-2003, 10:34 AM
That's a nice site. Please check your PM also.
unit3029
08-16-2003, 10:44 PM
great hack, will it work on vb3?
/me tries but oops we get a problem
mySQL error:Table 'deadlyf_PUB.post' doesn't exist
which it clearly does, is there a way to sort this or will this not work with vb3?
digitalJE5U5
09-07-2003, 06:46 PM
Hack looks great. However Im having a small problem?
Im getting these error messages:
Notice: Use of undefined constant threadid - assumed 'threadid' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 64
Notice: Use of undefined constant lastpost - assumed 'lastpost' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 67
Notice: Use of undefined constant lastposter - assumed 'lastposter' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 68
Notice: Use of undefined constant forumid - assumed 'forumid' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 69
Notice: Use of undefined constant open - assumed 'open' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 70
Notice: Use of undefined constant views - assumed 'views' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 71
Notice: Use of undefined constant replycount - assumed 'replycount' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 72
etc.
The new table loads, but is preceded by those errors.
Any help?
Thanks,
/DJ
digitalJE5U5
09-07-2003, 06:51 PM
BTW heres lines 52-72 if that helps:
$news = array();
while($tableLine = mysql_fetch_assoc($cekilen_news)) {
$tmpTableArray = array($tableLine);
$news = array_merge($news, $tmpTableArray); }
}
// Getting thread information for news articles
for ($i=0; $i<$news_number; $i++)
{
$cekilecek_thread_id=$news[$i][threadid];
$cekilen_thread=mysql_query("select lastpost, lastposter, forumid, open, views, replycount from thread where threadid=$cekilecek_thread_id");
if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;}
$news[$i][lastpost]=mysql_result($cekilen_thread,0, "lastpost");
$news[$i][lastposter]=mysql_result($cekilen_thread,0, "lastposter");
$news[$i][forumid]=mysql_result($cekilen_thread,0, "forumid");
$news[$i][open]=mysql_result($cekilen_thread,0, "open");
$news[$i][views]=mysql_result($cekilen_thread,0, "views");
$news[$i][replycount]=mysql_result($cekilen_thread,0, "replycount");
//getting forum name
Logician
09-07-2003, 06:54 PM
it is because of error reporting settings of your PHP installations. Adding:
error_reporting(7);
(to the hack code at the beginning of it just one line below <?php)
should fix the problem..
Or you can ask your server admin and make him disable NOTICE errors in php.ini but my solution is easier.. :)
digitalJE5U5
09-07-2003, 07:10 PM
I really appreciate the quick reply! Hack rocks, and support rocks!
Thanks again.
/DJ
Frzzy
09-08-2003, 07:35 PM
hey hey... i don't agree...
the notice say that these constant are undefined, so it will assume their name...
look at this...
$cekilecek_thread_id=$news[$i][threadid];
and this...
Notice: Use of undefined constant threadid - assumed 'threadid' in c:\inetpub\wwwroot\moodle\newsconfig.php on line 64
the parser assumed [threadid] is ['threadid'] isn't it? why just replace [threadid] with ['threadid']... the notice sure will gone...
btw, disable the error on production site is the general rule, instead use an error log... but let's think... if somewhere in the app, there's some constant named [threadid] defined before this code line... i'm sure it will mess up the result...
every parser error messages are bad... [notice] is just not as bad as [error]
^_^
Frzzy
09-08-2003, 09:00 PM
clicked install button...
great script... thank you...
a lil note... i think the logician_query.php script is not needed after advanced install... maybe no need at all... why do you don't tell everyone to remove it after install?
copyninja
09-18-2003, 10:56 PM
looks like a great script, and i was looking for sumthin as goos as this.. going to install it right now!
lasto
09-18-2003, 11:02 PM
Logician i hope u see this as need some info
I use a portal system where everything has a set place in boxes etc - but in these boxes i can enter any html code i want and it works.
Now if i install this hack - i know u can mark certain posts to be shown on a front page but what commands are used on the front page to actually call this in ??
Would they go in an html box etc
copyninja
09-18-2003, 11:49 PM
hm.. i installed it but i get this error on the main page where the news is supposed to be...
"mySQL error:Table 'db-name.post' doesn't exist" ..
db-name = MY Database ..
lasto
09-18-2003, 11:54 PM
have u ran the queries m8 as it seems its looking for a table that dont exist.
copyninja
09-18-2003, 11:58 PM
um.. since i dont know how to do that ... i dont think i ran queriers...
lasto
09-19-2003, 12:09 AM
give me 2 mins while i download hack and see what needs to be done m8
copyninja
09-19-2003, 12:10 AM
ok
lasto
09-19-2003, 12:12 AM
ok in the zip is a file called logician_query.php
you need to edit it with the relevant details
## Username and password to log onto your MYSQL database server
$dbusername='root'; //MYSQL username
$dbpassword=''; //MYSQL password
## Name of the MYSQL database that you want to access.
$dbname='test';
so basically these are the same as you use for your vbull board so is quite easy.
so once u edited it - upload it to the admin folder and then run it
forums/logician_query.php and it will add the tables for you.
Also dont forget to edit phpheader with same details m8
copyninja
09-19-2003, 12:16 AM
Ill try it but since i did the basic instalation ... it says i dont need to upload the logican_query.php ... thats what it says in the installation file...
lasto
09-19-2003, 12:19 AM
yep ok but u still need to do it to phpheader
i aint installed it m8 so only going off a quick read of the install instructions.
But u deffo missing some tables thats for sure
copyninja
09-19-2003, 12:24 AM
ehh.. i did it in the phpheader.. and i know im missing the tables ... i guess ill wait for Logician to respond...
Logician
09-19-2003, 09:58 AM
"mySQL error:Table 'db-name.post' doesn't exist" ..
Make sure you edited this section in phpheader.php file correctly:
## Username and password to log onto your MYSQL database server
$dbusername='test'; //MYSQL username
$dbpassword='pass'; //MYSQL password
## Name of the MYSQL database that vbulletin data exits.
$dbname='testdb';
Especially make sure you entered dbname correctly because the error indicates that the name you entered there is not your vbulletin database. You can check "forum/admin/config.php" to make sure what database is your vb is using.
I use a portal system where everything has a set place in boxes etc - but in these boxes i can enter any html code i want and it works.
Now if i install this hack - i know u can mark certain posts to be shown on a front page but what commands are used on the front page to actually call this in ??
This is hard to answer. You may try to apply STEP 2 into your portal file and this may work but there is no guarentee because you are now trying to incorporate this hack to an alien script. There might be unexpected problems: For example some function names or variables names in both scripts can be same and they might clash etc.
copyninja
09-19-2003, 10:20 AM
O ok so im supposed to you the same database the vB is using? ... damn im dumb lol.. i made a whole new databse for this lol, i'll change it when i come home today afterschool.
copyninja
09-19-2003, 10:41 AM
ok i did what you said...
and i wrote several news threads....and when i look @ where the news is supposed to go to.. it just says
"News has been compiled in 0.0143 seconds."
and it shows no news though/
Logician
09-19-2003, 10:57 AM
ok i did what you said...
and i wrote several news threads....and when i look @ where the news is supposed to go to.. it just says
"News has been compiled in 0.0143 seconds."
and it shows no news though/
Check your phpheader.php very carefully and make sure every config applies to your board.
For instance your problem usually happens because you didn't edit the part:
## News Posters' Names
## You set here which users can post news. Use their forum names and be careful about caps.
## if you want all members to post news (of course if they know the relevant tags) simply put // just in the begining of the line
$news_posters=array("Admin", "Poster2");
copyninja
09-19-2003, 11:00 AM
yes i edited that ...
## News Posters' Names
## You set here which users can post news. Use their forum names and be careful about caps.
## if you want all members to post news (of course if they know the relevant tags) simply put // just in the begining of the line
$news_posters=array("Rocky", "Poster2");
Logician
09-19-2003, 11:07 AM
and checked other phpheader.php options too? Say:
## Forum IDs open to News Posting
## Script will compile the news from these forums only.
## To learn what a forum's id is, login CP, go to Forums&Moderators/Modify, Put your mouse ON forum name you want to learn its ID
## and you'll see the ID number in IE's taskbar.
## if you want all forums to be open to news posting simply put // just in the begining of the line
$news_forums=array("1");
copyninja
09-19-2003, 06:51 PM
Thank you very much .. i just need to change the way the news looks when posted, thank you for all the quick reposnses :)
copyninja
09-19-2003, 08:06 PM
o damn sorry to double post but ... my concern is not post count of these boards lol neways...
i would like to change the format of the date in 2 ways ..
i would delete the part that says "Past Date:" because i dont need that part...
also i would like the date to read (random date) .."9/18/2003 at 'time'"
ALSO this right here may be asking alot lol so if it is you dont have accomodate this request, anyway you think you make it so that the time is in a 12hour format and then you can use am or pm ...
Logician
09-20-2003, 08:59 AM
o damn sorry to double post but ... my concern is not post count of these boards lol neways...
i would like to change the format of the date in 2 ways ..
i would delete the part that says "Past Date:" because i dont need that part...
also i would like the date to read (random date) .."9/18/2003 at 'time'"
ALSO this right here may be asking alot lol so if it is you dont have accomodate this request, anyway you think you make it so that the time is in a 12hour format and then you can use am or pm ...
edit phpheader.php, find the line:
return date ("Y-d-m H:i:s", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));
Change the "Y-d-m H:i:s" part (only that part!) according to the info here:
http://tr.php.net/date
copyninja
09-20-2003, 03:45 PM
thank you
NecroSocial
03-03-2004, 09:40 PM
Logician I'm trying to get the news table to match the design specs for my site's main page. I know I can get the text to layout properly however I'd like to have the option of including a graphic along-side the intro text (see the attached image for an example of what I'm trying to do). I had the idea of making a new vbcode (something like [newsimage={file}]) that could be included in news posts. However I'd like to know how to get your script to pick-up the file so I could drop it into my table as one of the news variables (££nImage££ or some such). Any ideas on how this could be accomplished?
Logician
03-04-2004, 06:03 AM
Logician I'm trying to get the news table to match the design specs for my site's main page. I know I can get the text to layout properly however I'd like to have the option of including a graphic along-side the intro text (see the attached image for an example of what I'm trying to do). I had the idea of making a new vbcode (something like [newsimage={file}]) that could be included in news posts. However I'd like to know how to get your script to pick-up the file so I could drop it into my table as one of the news variables (??nImage?? or some such). Any ideas on how this could be accomplished?
If you are going to use a fixed image in all news items, you can edit the new HTML code which is in phpheader.php (variable $newstablesample).
But if you want to insert a different image per news, this wouldn't easily be possible without tweaking with the hack structure.
NecroSocial
03-05-2004, 03:38 PM
Yeah I'm looking to include a different image per post. I'm fully willing to tweak if you're up for showing me what to tweak. :)
seattlecane
03-07-2004, 02:29 AM
very nice, solves my problems
BlackxRam
03-28-2004, 08:30 AM
Is there a Vb3 version of this in the pipe!?
Logician
03-28-2004, 12:32 PM
Is there a Vb3 version of this in the pipe!?
nope and unlike my other hacks I'm not yet sure if I'll port this over. If someone is eager to work on this hack's VB3 porting, he can contact me.
higmet
04-02-2004, 01:29 PM
the old hack works fine on my vb3 testboard
MeTaL_oRgY
04-07-2004, 05:26 PM
Hey logician! How ya doing??.... well, I installed this and it works perfectly, I just need one more thing though... I want the avatar of the news poster to appear on the index of my site... is this possible withouth modifying the SQL?... if no, then its just fine :) I just wanted to ask :)
Thnx for another GREAT hack!
MeTaL_oRgY
04-09-2004, 12:09 AM
hey logician... humm.. sorry for being such an annoying guy... but I think u are the only one who can help me....
first of all, I don?t care about the avatar thing anymore.... I create a news template that looks quite good :)... but I have a functionality problem...
I have my site in both, english and spanish, so I need two news scripts (I used to use fusionnews... but it was too slow to login, write the news, then logout and then do it all over again on the other script... it worked, but it was too slow...). I?ve installed this script in two different folders, noticias and news. Then installed the advanced way and post a news item on my spanish forum. worked.. perfectly... then posted on the english one.. perfect again, both showing on their respective pages. The problem came when I posted agian on the english forum, one newswriter posted and the old post dissapeared from the mainpage... I thought it may be a installation error but no. I then tried to post another news on the english forum and nothing, the post my friend created was(and still is) the only one that can be viewed on the english main page... even if I post a newer news item.. X.x...
I can post again on the spanish forum and it works perfectly... they started deleting each others [news]tags, but that was an easy tsolve problem... (just had to set "$remove_news_tag" to 0) but now I?m desperate... plz help!
here are some URLS that may be helfull:
http://zelda.wi3k.net/home2.php <-- english mainpage
http://zelda.wi3k.net/foro/forumdisplay.php?forumid=22 <-- english news forum
http://zelda.wi3k.net/home.php <-- spanish mainpage
http://zelda.wi3k.net/foro/forumdisplay.php?forumid=23 <-- spanish news forum
hope u can help me... I think the solution is to create a whole new script.. kinda... for the english news... I mean, with different variables, tags and everything.. but I?m unsure.... :)
thnx in advance and sorry for being so annoying (again)...
BTW I?ve double and triple checked the phpheader.php file of both, english and spanish and they are right. also, every post has the tags within it :o...
Logician
04-09-2004, 05:20 AM
The script is designed to turn off news tags when a news is not pulled into the news page for a reason. In your example when spanish script runs, english news is not pulled since their forum id is not matched so the script deletes them.
This should fix your problem:
find:
if (($remove_news_tag==1) AND ($news[$i][printable]==0))
and replace it as:
if (($remove_news_tag==1) AND ($news[$i][printable]==0) AND inarray($news[$i][forumid],$news_forums))
MeTaL_oRgY
04-09-2004, 04:24 PM
lol.. it didn?t.... I, the administrator, can?t post news.. I logged in as "Zeldafan" (my other news poster" and it worked... kinda... it replaced the other new with the one I posted under his name... of course I?ve checked this: $max_news=0; so I dunno what the problem is... :oops:..... again sorry for beeing so annoying :s...
[EDIT]
mmmm.. now it?s weirder.. it says: "news hve been compied in xxxxx seconds" but nothing appears!!... Oo... and the spanish one has just 1 news (there are 2 news on the forum @@....
[EDIT]
I installed all over again from start, of course, replacing the text that u gave me logician, and here?s what I get:
Fatal error: Call to undefined function: inarray() in /usr/home/wi3knet/public_html/zelda/noticias/newsconfig.php on line 409
:(......
Logician
04-09-2004, 07:13 PM
sorry should be in_array not inarray
MeTaL_oRgY
04-09-2004, 07:30 PM
lol, thnx, it solve the fatal error problem, but it?s not compiling the news.. I?ll try erasing the forums and creating new ones and installing all over.. I?ll tell u how it came out after :)
[EDIT]
lol, I did what stated above... english poster posted a news on english and I posted in spanish... again, spanish is working and english isn?t... english just says: "News has been compiled in 0.0535 seconds." but the news don?t appear... I did a new install (downloaded and started all over again) for both files, I erased the old forums and created new ones, what changed their ID?s.... I checked all twice and it?s not working. I think it?s the hack since it?s not created to support two different languages in two different pages.... but I dunno :ermm:
any ideas?... if it?s too much trouble just tell me and I?ll install fusionnews or something for the enlgish part.. (damn.. >.<).....
gmarik
06-17-2004, 12:19 PM
Logicina,
Warning: mysql_connect(): Access denied for user: 'a0005075@localhost' (Using password: YES) in /home/logician/public_html/newsdemo/newsconfig.php on line 26
Couldnt find MYSQL!
higmet
06-17-2004, 12:25 PM
check your database settings in phpheader.php
vBTotal
08-10-2004, 09:35 PM
will this work for 3.x?
jalliday
02-20-2005, 06:23 PM
i've installed this hack a year ago, now i've upgraded to vb3 and it still works.
great
works with vbulletin 3.06
Logician
02-20-2005, 06:32 PM
i've installed this hack a year ago, now i've upgraded to vb3 and it still works.
great
works with vbulletin 3.06
really??? even I didn't know this lol
jalliday
03-03-2005, 12:35 PM
with an upgrade, it works.i didnt tried with a new install.
YoricksRequiem
03-03-2005, 10:43 PM
Can we get details on how to use it for vb3? It would be awesome :D!
unit3029
12-03-2006, 10:16 PM
I still use this even now in vb 3.6.4 , Fresh install :)
the only problem i have with it now is the ability to hide the tags from people who use quote.
We used to have to edit the newreply.php and add a small drop of code, however cant see where to continue doing this as the newreply.php no longer has that code or at least has changed considerably.
OLD Instructions:-
Step 4: (Optional)
What if you use news tags in a message and someone replies this message by pressing "QUOTE" in the original thread? Your news tags will be revealed to him. IF he is not authorized to send news, this is no big deal but if you want to hide them anyway, you can apply this optional hack too:
Edit newreply.php and find
$postdate=vbdate($dateformat,$postinfo[dateline]);
$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=htmlspecialchars($postinfo[pagetext]);
Before that add this:
$pagetext = preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(options)(])(\r\n)*([^\"]*)(\[\/options\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(intro)(])(\r\n)*([^\"]*)(\[\/intro\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(summary)(])(\r\n)*([^\"]*)(\[\/summary\])/siU", "" ,$pagetext);
Save and upload newreply.php..
If you get the time, Id appreciate an update to this :)
also do you know if its possible to hide the buttons on the advanced wysiwyg editor from specific groups ?
renalpha
12-13-2006, 05:11 PM
i get an error when i try this
mySQL error:Table 'squaddes_Vbulletin.post' doesn't exist
it is in the phpmyadmin stuff
code.
<?php
################################################## #####################
##
## Logician NEWS Script. \\=^))
##
## Pulls messages having NEWS mark from your vbulletin database
## and posts/inserts in your non-vb web page.
##
################################################## #####################
##
## Please Edit the OPTIONS BELOW according to your config and needs:
##
################################################## #####################
## Hostname or IP of your server where MYSQL database resides.
$servername='localhost';
## Username and password to log onto your MYSQL database server
$dbusername='squaddes_vbullet'; //MYSQL username
$dbpassword='********'; //MYSQL password
## Name of the MYSQL database that vbulletin data exits.
$dbname='squaddes_Vbulletin';
$dbprefix='vb1';
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.