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)

JJR512 01-07-2002 03:59 PM

The Realist, I don't know what to tell you...there's no logical reason it should work one minute, but not the next, unless it was some kind of problem that everyone was having. I don't have it, I know another website that uses this and they don't have it... If you'd like to discuss it further, please contact me via PM or email. I might like to look at your database or try posting a news item myself.

***

This hack has been updated to have the multi-page feature. This is just like a forumdisplay or showthread, so now instead of being limited to showing the most recent 10 (or whatever number you specified) news items, users can have access to older items by just going to the next page.

I will probably next try to see if I can come up with a date limiting option instead of just a hard number, so you can set it so all news items from the past day or two days or whatever show up, regardless of how many items that is.

If you already have installed the previous version, all you need to do is re-upload homeindex.php and update the main_newindex template, either with the one from the text file if you haven't modified it, or by adding $pagenav to an appropriate location (this is the variable that displays the page links).

DarkReaper 01-07-2002 11:25 PM

It'd be very helpful if you posted all updates in the main post, as well as a link to the attachment. I was re-routed 4 different times when trying to find the download... :)

slideboxer 01-08-2002 03:05 AM

When will you get the POLL function operating?

JJR512 01-08-2002 03:31 AM

Well, I just don't see that it's possible to post a poll and news item at the same time...each requires you to go to separate redirects for a setup screen. It's either one or the other. If you really want a news item from a poll thread, you should post the thread as a poll, then copy the URL and use it to make a new news item via the link on the news page.

I suppose what I need to do is put in a routine either like the one you made, which assumes that if the poll box is checked, to make it a poll and not a news item, or else the opposite version that assumes if the make news box is checked, to do that instead of making it a poll.

Comments?

slideboxer 01-08-2002 03:44 AM

What if it redirected to a template that contained the setups for both news and polls?

JJR512 01-08-2002 03:50 AM

I'm sure it's possible, it's just sounds more complicated than I want to think about right now. :stupid:

slideboxer 01-08-2002 03:55 AM

Don't let that stop you :D

Thanks for the hack, BTW.

Mutt 01-16-2002 09:35 PM

[QUOTE]Originally posted by bigmattyh
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); 


TECK 01-20-2002 12:16 AM

i made this little script to automatically install(remove) the set of templates with one click of a button.

i test it and it works great. :D let me know what you think

TECK 01-20-2002 01:52 AM

here it is:

dlst 01-23-2002 07:27 AM

Hi JJR512, thanks for all the hard work you've put into this.

I've installed the latest release, and have found the following problems/bugs that I haven't seen mentioned:

problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?

problem 2: Javascript Error in newspost.php

Start a new thread, making the thread a news item. You get redirected to newspost.php.
Click on "Submit" after making no changes to your input.
The following error occurs:

A javascript pop-up (via IE5.5) with "A run-time error has occurred, line 58 with the following error:
'subject.value' is null or not an object"

The script continues to process, and you end up at homeindex.php, but no news items show up. The page is otherwise complete, but without news items. I get the empty page you see here: http://207.235.6.72/forum/homeindex.php

problem 3: Permissions problem in forumpermission.php

If you go to the admin, under "Forums & Moderators", click on "Permissions"
If you set custom permissions for a forum here, it has the effect of DISallowing news posting privileges for the group whom you have just changed.

For example, if you click on Administrators-Edit, select "Use Custom Settings", leave ALL the settings alone, and submit... you will find that Administrators are no longer able to post news items to that board.

-------

Thanks again for this great hack.

-dlst

dlst 01-26-2002 03:28 AM

Hmmm... anybody home? Well in case anyone is reading this thread, I found the solution to the Javascipt error I found:

[QUOTE]Originally posted by dlst

problem 2: Javascript Error in newspost.php

Start a new thread, making the thread a news item. You get redirected to newspost.php.
Click on "Submit" after making no changes to your input.
The following error occurs:

A javascript pop-up (via IE5.5) with "A run-time error has occurred, line 58 with the following error:
'subject.value' is null or not an object"

[/B]

dlst 01-26-2002 03:50 AM

Man, I'm on a role... I fixed problem one (sort of). First, here's the problem (quoted from above):

[QUOTE]Originally posted by dlst
problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?


dlst 01-26-2002 04:37 AM

Ok fine, I'll do my own homework! Sheesh. J/K :)

As I posted above, It would be nice to have the script verify the validity of the URL and present the user with a meaningful error message... and NEVER a MySQL error. Well, it's done, with a few modifications to newspost.php.

[QUOTE]Originally posted by dlst
problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?


TECK 01-26-2002 04:00 PM

[QUOTE]Originally posted by slideboxer
Is there a way I can call the news from another page, a non-vb page?

slideboxer 01-26-2002 05:39 PM

Nakkid, thanks a bunch.

Mutt 01-27-2002 11:39 PM

Ok, I know you guys are all working with the new version of this hack, but I'm still using the original one and I love the results. the newer one just had too much going on. the original hack was simple and did a great job. make a post and mark it to be placed on the homepage. done and simple. I I have it ignore poll posts that have been marked as news. then copied the get news sub and have it ignore all non poll posts using differnt tempates for those.

now I have my news items donw the center, activbe topics off to the side, and polls in a small box to the side. you can vote from there or if you've already voted you see the results. I also added a modified version of the vbportal calendar and remake of the welcome panel.

anyway, just wanted to say thanks for the great any forum news hack. When I'm done with it, it's going to make for a real nice homepage

http://www.ccdv.com/forum/homeindex.php

PS - I'd still like to come up with a nice way to truncate the message without screwing up the vbcode and without this whole second post thing in the new version. bigmattyh had something that looked like it would work, but I couldn't get it to. :(

bigmattyh 01-27-2002 11:43 PM

Hey Mutt,

I think I'll go back and see if I can include a different version of the truncation process -- one that's much more flexible. Maybe tonight, or tomorrow?

Matt

slideboxer 02-01-2002 03:06 AM

I'm sure this is probably an easy fix but I'm simply no hacker - cut and paste? now that's a different story :) . I'm trying to include my welcome panel (from the welcome panel hack) in the main_newindex template. How do I get the welcome panel information to display in in this template the same way it does in the forumhome template?

Plus, any news on getting the polls to work?

SirSteve 02-01-2002 12:45 PM

Am I able to select/override what forums/subforums the "News" checkbox is in? Obviously, if I have a news forum, I don't need this checkbox to be displayed.

Pete 02-01-2002 09:07 PM

I've bounced all over the board following this hack ;)

Just wondering if the idea of an additional field for a brief description of the news made it into the hack. This would make sloppy pasting of headlines output much nicer to the front page!

slideboxer 02-02-2002 01:43 AM

[QUOTE]Originally posted by slideboxer
I'm sure this is probably an easy fix but I'm simply no hacker - cut and paste? now that's a different story :) . I'm trying to include my welcome panel (from the welcome panel hack) in the main_newindex template. How do I get the welcome panel information to display in in this template the same way it does in the forumhome template?

Mutt 02-04-2002 10:54 PM

[QUOTE]Originally posted by bigmattyh
Hey Mutt,

I think I'll go back and see if I can include a different version of the truncation process -- one that's much more flexible. Maybe tonight, or tomorrow?

Matt

JJR512 02-06-2002 01:57 AM

Pete, not sure what it is you're looking for, I don't think I understood. ???

Just to let everyone know, I'm working on a little addition to this that lets you show a picture. Now you can already have a picture show up in the news item simply by using the img vB Code tag in the normal way. But what I don't like about that, personally, is that doing this, the text doesn't wrap around the image. So what I want to do is add another field to the create news page, where you can put in a URL to an image. If you leave it blank, nothing special happens. If you put a URL in, though, it causes new HTML code to go into the news item that is an <img ...> tag complete with wrapping instructions, probably align=left with the image on the left side, so that text will go around the right and bottom of the image.

Pete 02-06-2002 12:23 PM

I was doing some searching for this idea & landed in your thread. I'll try to explain what I had in mind, your idea from the original post was close:[QUOTE]instead of the thread being posted straight away, instead, first you are taken to another page with a textarea containing the contents of the post. In this second textarea, which contains what you just typed in the normal newthread screen, you can edit or change what you typed, and what you do here would get stored in an additional field added to the thread table, and this is what would get shown on the news page.

JJR512 02-08-2002 05:02 PM

Where is this additional text field supposed to go? Since you don't want to have a second page, I guess it's supposed to go on the newthread page, is that correct? My first impression of this idea is that if it's a new textarea on the newthread page, then you have to fill it out separately, whereas the way my hack works, on the second page, it's already filled out. You don't have to do anything to it, if you don't want; you could just submit it. Or if you want it to be shorter, you can shorten it manually, taking out whatever parts you don't want and leaving whatever you do want, which I feel is better than just being limited to the first xx-number of characters. (Sometimes I don't want the first few lines because it has redundant or unnecessary data.) It is what you leave in the textarea on the second page that goes to the front page.

slideboxer 02-08-2002 05:20 PM

Hey, JJR512, any news on getting the polls to work with this?

ptenthus 02-09-2002 11:58 AM

Polls don't work for anyone on my board since I put this hack in place. Everything else works fine, just anyone trying to post a poll goes to a blank white screen.

Ideas?

dlst 02-09-2002 01:58 PM

[QUOTE]Originally posted by ptenthus
Polls don't work for anyone on my board since I put this hack in place. Everything else works fine, just anyone trying to post a poll goes to a blank white screen.

Ideas?

JJR512 02-09-2002 04:26 PM

No, I haven't had that problem, so I don't know how successful I'll be trying to fix it.

dlst 02-09-2002 05:20 PM

[QUOTE]Originally posted by ptenthus
Polls don't work for anyone on my board since I put this hack in place. Everything else works fine, just anyone trying to post a poll goes to a blank white screen.

Ideas?

slideboxer 02-09-2002 09:07 PM

Awesome, this worked. Thanks.

dlst 02-09-2002 11:20 PM

[QUOTE]Originally posted by slideboxer
Awesome, this worked. Thanks.

JJR512 02-10-2002 01:24 AM

UPDATE

I have updated this hack. Updates include a fix to the poll vs. news issue which goes a bit beyond what's just been discussed...Now you will be able to BOTH post a poll AND a news item at the same time! If you check both boxes, first you are redirected to the poll setup page, you do that as normal, then after submitting the poll you are redirected to the news item setup page, which again is done as normal. The new redirect scheme does work correctly now if you ONLY selected to post a poll, ONLY selected to post a news item, or selected BOTH. (The correct action or result will happen.)

I've also built in the image feature I mentioned earlier.

This news is FYI only at this time, as I am not releasing the updated hack just yet. I have only just completed testing of the new redirection and poll+news system; I still need to document it. Additionally, I am re-writing all of the variables used so that they more closely resemble the style of vBulletin (the $xxx[yyy] style). It is my hope that once I get all of that done, that we can get this out of beta and make it an official release. :)

dlst 02-10-2002 01:33 AM

I am SO ready to help beta test your new implementation... even, *sigh* help write/proof-read documentation (do you hate writing it as much as everyone else?). Whatever I can do to help.

Did I mention? THANKS for this hack.

JJR512 02-10-2002 05:58 AM

dlst, check your PMs! ;)

Dark_Wizard 02-11-2002 04:19 PM

I would love to help test this as well as I would like to port it to phpportals. Please let me know if your accepting any beta testers. TIA!

JJR512 02-12-2002 01:41 AM

OK, you have a PM too!

Just as an update to everyone else, unless I hear about any problems from the few pre-release beta testers of the new version, I will be publically releasing it in a few days. :)

pdaGuy 02-13-2002 05:42 AM

JJR512,
this is the best hack I've seen to date!! Congrats!
I'm setting up my site with it and I'll soon make a post here for everyone to see it.

I have a small problem though!
How can I use the include or require statement on the homeindex.php?
What I need to do is include a Poll (not a thread with a poll) on the homeindex.php
But I can't use php code on the vBulleting templates. Any ideas?

FYI the Poll that I want to include on the homeindex.php is a separate poll script and in its readme file it says to add the following on the page.
[QUOTE]<?php
$newest_poll = 1;
require("http://www.mysite.com/poll/booth.php");
?>

squawell 02-13-2002 09:42 AM

JJR512 see the attch file that's my problem!!

i want the blank part show something where should i edit??

and sorry use ur forum's pic to do my example!


All times are GMT. The time now is 04:16 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.01618 seconds
  • Memory Usage 1,841KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (40)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