vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Any-forum News hack (https://vborg.vbsupport.ru/showthread.php?t=33314)

sianews 12-18-2001 06:45 PM

Steve, that's the exact same thing I would like. The news just goes into a queue and you can checkk "yes" or "no". Is that a possibility JJR512?

SirSteve 12-18-2001 06:51 PM

[QUOTE]Originally posted by sianews
Steve, that's the exact same thing I would like. The news just goes into a queue and you can checkk "yes" or "no". Is that a possibility JJR512?

JJR512 12-18-2001 09:17 PM

sianews, about the URL thing, that should be pretty easy to add, I'll be able to get that done soon. This hadn't occured to me because I include a link to the source article in the message body itself anyway.

Now about the moderation queue for news items... that sounds like a good idea. I'll have to see if I can figure something out. Now do you want the thread itself to still get posted and be visible, while it waits to show up on the news page? Or do you want the thread to not show up at all while it's waiting for approval?

SirSteve 12-18-2001 09:34 PM

[QUOTE]Originally posted by JJR512
Now about the moderation queue for news items... that sounds like a good idea. I'll have to see if I can figure something out. Now do you want the thread itself to still get posted and be visible, while it waits to show up on the news page?

sianews 12-18-2001 09:54 PM

Sounds great - looking forward to it.

I always put a link in my article too, but this way would eliminate a step. Alternativly, you could make the headline print our like:

"This is the headline" - Read Post

With the headline linking to the source and the read post linking to the post. Also, instead of a checkbox, how about of the URL field has something in it, that acts as the "yes" in order for it to be posted on the front page. But that might limit the usefulness to people doing other things. Maybe an option or something.

bigmattyh 12-18-2001 11:48 PM

Hey, I've noticed that the news index file only seems to work on my system when I place it in the forums directory. Is there any way to fix this so that it works in any directory? Or did I mess something up?

bigmattyh 12-19-2001 01:14 AM

FYI, if you want to use HTML in your news instead of vbcode, you can go into the homeindex.php file and replace[QUOTE]$gnpagetext=bbcodeparse($gnpagetext);

bigmattyh 12-19-2001 02:39 AM

Hey JJR, I hope you don't mind, but since you created a hack that I really happened to need -- at the moment I needed it -- I made a couple of customizations that really suited my purposes.

This is one I think a lot of people might be interested in.

I've always liked being able to cut short a news article on the main page, say, to a paragraph or two. Then you can click on a "READ MORE" link or something to that effect, so you don't end up taking up so much space on your home page.

So, I've modified the aforeposted hack to add this functionality.

This extra little bit of code will read the post, separate out the paragraphs, and if the post runs longer than your preset maximum number of paragraphs, it adds a "MORE >>" link at the end of the text.

Around line 20-ish, you'll see a line like this:
PHP Code:

$gnpagetext=bbcodeparse($gnpagetext); 

After this line, insert the following code:
PHP Code:

$maxpars 2;  // The maximum number of paragraphs you want to show
$gnpagetext=ereg_replace("(<br />|\n|\r)+""\n"$gnpagetext);
$gnpagetext=ereg_replace("(\n)+""\n"$gnpagetext);
$gnparagraphs=explode("\n"$gnpagetext);
for (
$par 0; (($par $maxpars) and ($gnparagraphs[$par] <> "")); $par++) {
  
$parcache[$par]=$gnparagraphs[$par];
}
$gnpagetext implode("\n <br /><br /> \n"$parcache);
if (
$gnparagraphs[$maxpars]) {
  
$gnmorelink="<a href=\"showthread.php?s=$session[sessionhash]&threadid=$gnthreadid\">MORE »</a>";  
}
unset(
$parcache); 

$maxpars (in case you couldn't guess) is the maximum number of paragraphs you want to show. If you set it to 1, you'll only see one paragraph of the news, etc. etc. etc.

And you'll have to add $gnmorelink after $gnpagetext in the templates.

Please test it out! Enjoy!

Goldfinger 12-19-2001 07:06 AM

Looks GREAT :).. one feature i'd like to see is maybe being able to include the person's avatar if they have one.

The Realist 12-19-2001 02:50 PM

Installed this beta hack for a test and Im not able to keep the Can make new threads a News item ticked on the option I need.

Its ticked on (NO) as default, but when I go to change the option to (YES) it does not save it, so therefore the option does not appear in the bottom table of the post.

Also, were does the homeindex.php file go, is it into root of the forum or admin?.............. does not say? and were is the newspages called from/viewed by the members or must a link be placed in a template?

Thanks,

:D


All times are GMT. The time now is 07:56 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.01318 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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