vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Logician NEWS: Drag Any Message to Your Main Page (https://vborg.vbsupport.ru/showthread.php?t=39278)

Logician 06-10-2002 12:34 PM

Quote:

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.

Till 06-10-2002 12:53 PM

Quote:

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. :)

PHP Code:

SELECT FROM_UNIXTIME(lastpost,'%y/%m/%d %h:%i') AS threadPOSTED FROM thread 

Just in case anyone needs it.

Till 06-10-2002 12:54 PM

Oh, or "dateline" of course! :D

Thanks for your help, Logician!

_till

SWF 06-14-2002 06:32 AM

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 [news][/news] 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

Quote:

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.

Quote:

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.

Quote:

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.

Quote:

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:
PHP Code:

## 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
PHP Code:

## 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:
PHP Code:

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:

PHP Code:

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:
PHP Code:

if ($run_time

Replace it as:
PHP Code:

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.


All times are GMT. The time now is 11:32 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01246 seconds
  • Memory Usage 1,775KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

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

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