Log in

View Full Version : Any-forum News hack


JJR512
12-17-2001, 10:00 PM
We've all seen plenty of news hacks here before. I'm talking about a hack that gets all new threads in a specific forum and shows the first post from the new threads on a separate, non-vB page. These hacks usually show a specific number of threads that you specify, or all threads from the past number of days that you specify. The forum that these threads come from is setup by you, by putting the forumid numbers in a variable in the hack's code file.

I feel that this is a limited system. You are limited to posting news items only in the one or few threads that you specify up front are to be used to get news items from, and then those forums are limited to only posting news items in (because every new thread in it becomes a news item). This just didn't seem like the best solution to me, because if I wanted to cover a particular topic, for example, computer hardware, I would have to have two separate forums: One to post hardware news, and one for non-news items like help and tips.

So what makes my hack different is that you can now post news items in ANY forum. When you post a new thread, there will be a new option in the same area as "parse urls" and "disable smilies"; this new option is called, "make a news item?" If you leave that box unchecked, the thread gets posted as normal. But if you check it, then not only does the thread get posted, but it will also show up on a separate page. So now, you can post news items and non-news items in the same forum, in any forum, and only the threads you want to be news items will show up as news items.

I have set up a permission for this checkbox, so it will only appear for the usergroups you want it to appear for. Setting this permission is just like setting any other usergroup permission, like the ability for the usergroup to post new threads, move threads, download attachments, etc.

You can change the news status of a thread, in other words, change a thread from being a news item to not a news item, or vice-versa, via a new option that appears on the Edit Thread screen from the Admin Tools.

This hack also includes a simple "latest threads" feature, that on the same page as the news items will show the most recently-replied to threads (the most recently active threads). I did these two things together because I knew they would be very similar to code, and would appear on the same page. However, each part is completely separate from the other part, and it is very easy to only use one part of the hack or the other.

Here is an image of the checkbox:
http://www.jjr512.com/testvb/attachment.php?s=&postid=6

Here is the new permission setup (by default, for any new usergroups you create, this permission will be set to 'NO'):
http://www.jjr512.com/testvb/attachment.php?s=&postid=7

There is a working demo of this hack. The test forums is located here (http://www.jjr512.com/testvb/index.php?s=), and the news page is located here (http://www.jjr512.com/testvb/homeindex.php). You can use the test forums as an unregistered user; I have set up the unregistered usergroup to have Super Moderator powers, so you should be able to play around with the Edit Thread admin tool, etc.

I'm posting this in the Beta forums because I'd like for some other people to let me know it works OK for them. It works fine for me, on two boards; I originally wrote it and developed it for my regular board, which was heavily hacked to begin with. I then setup a clean, unhacked, totally stock board as a testing grounds, and recreated the hack, and again, it worked fine. I want to confirm that it works fine for at least one other person, but I'm also hoping that someone more experienced than myself can take a look at it to see if I've coded it the best way possible.

The other issue I hope to address here in Beta relates to how the text from news item threads is formatted to appear on the news page. Currently, this hack gets the entire contents of the first post of a thread, and it is run through the bbcode parser, so what you see on the news page is just like what you see in the thread itself, including smilies, all vB Code tags converted, etc. Also, the entire post is used; it is not run through any process that limits it to a certain number of characters. The reason I did not set up a character limit was mainly so that the bbcode parser would not get confused if a closing tag was completely or partially cut out. I figured that since I included a permission system, that at least for me would limit the ability to make a thread a news item to Admins and Mods, I could teach my staff to keep news item threads short.

However, I have toyed with the idea (in my mind) of changing the hack so that if you check a box to make a thread a news item, when you submit the thread, 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. That way, you could start a thread, put an entire news article in it or whatever, mark it to be a news item, submit it, then pare down the contents of the post to just a little blurb suitable for a news item display on the news page, while the original bit you typed gets saved as a post and shown in the thread as normal. (Hope that makes sense.) If I hear enough of a demand for something like this, or get any other ideas, I may consider it. The downside to this is it becomes a little more complicated to post a news item thread.

OK, so install it or play with the demo, and let me know if it's ready for a full release! :)

Edit on Jan. 1, 2002: This hack has been updated to Version 2, with new features as discussed throughout this thread. Please go to this post: https://vborg.vbsupport.ru/showthread.php?postid=210281#post210281

TheComputerGuy
12-18-2001, 09:20 AM
Thats SWEET!!!!!...

i like it

bokhalifa
12-18-2001, 01:09 PM
coool


good hack :D

Lesane
12-18-2001, 02:17 PM
Fantastic! ;) Well done.

LuBi
12-18-2001, 03:05 PM
Great! very well done!

KuraFire
12-18-2001, 04:01 PM
Good hack. Not personally needed, but I can see the use of it. Good job :up:

ethank
12-18-2001, 04:25 PM
Interesting hack. I might be using this :)

EThan

sianews
12-18-2001, 05:23 PM
Looks great, will defintly be using that.

I was trying to modify another script to do the same thing, but here it was, already completed :).

I was having trouble creating a new field (like the checkbox). I want to create a "URL" filed under the title box. If the story has a link people would put the URL in the new field, then the front page (when clicking on the headline) would take you to the news source. Is there anyway to do that?

ThaSpecialist
12-18-2001, 06:39 PM
Cool Hack! :D

SirSteve
12-18-2001, 06:41 PM
I posted a request for this exact same thing a while back! Very cool! The only thing I can see is that I would like to be able to OK the submitted news threads before they are posted on my home page.

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:$gnpagetext=bbcodeparse($gnpagetext);After this line, insert the following 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

JJR512
12-19-2001, 03:07 PM
The file homeindex.php goes in the forums folder. So far, I haven't gotten it to work outside of it, although it should be a simple matter of changing the path to global.php at the top of the file.

As for your other problem, I'm not sure I understand...is it that the checkbox does not stay checked? Or the option itself does not show up at all?

The Realist
12-19-2001, 03:11 PM
The option shows ok, but when checked it does not stay checked but reverts back to its original setting.

;(


[QUOTE]Originally posted by JJR512
The file homeindex.php goes in the forums folder. So far, I haven't gotten it to work outside of it, although it should be a simple matter of changing the path to global.php at the top of the file.

As for your other problem, I'm not sure I understand...is it that the checkbox does not stay checked? Or the option itself does not show up at all?

JJR512
12-19-2001, 05:32 PM
If the checkbox isn't staying checked, I would suspect something is wrong with the installation of the hack. Possibly related to Step 2-B-2...it sounds like the setting isn't getting stored in the database. Can you run through the installation steps again, comparing what it says to do with what you actually did?

Unless you find any problems there, can you use something like phpMyAdmin or some other way to look at the database? If so, start a test thread, mark it to be news, and post it. Then look in the database, in the threads table, find the new thread (look for the threadid), and see if the isnews column for that thread is 0 or 1 (should be 1).

Anybody else having this problem?

The Realist
12-19-2001, 06:43 PM
Did what was said (below) but Im not getting the link to show that enables me to post the thread, see attached.

Strange?




[QUOTE]Originally posted by JJR512
If the checkbox isn't staying checked, I would suspect something is wrong with the installation of the hack. Possibly related to Step 2-B-2...it sounds like the setting isn't getting stored in the database. Can you run through the installation steps again, comparing what it says to do with what you actually did?

Unless you find any problems there, can you use something like phpMyAdmin or some other way to look at the database? If so, start a test thread, mark it to be news, and post it. Then look in the database, in the threads table, find the new thread (look for the threadid), and see if the isnews column for that thread is 0 or 1 (should be 1).

Anybody else having this problem?

The Realist
12-19-2001, 06:47 PM
Followed the Instructions 110% and still not able to get the box to stay ticked.

Strange?

JJR512
12-19-2001, 07:00 PM
I guess part of my problem understanding your problem has been some communication difficulties... specifically, you talking about the check box, when what I see you really meant was the radio button. You see, square boxes that you put a checkmark into are called "check boxes", while round circles that you put a dot into are called "radio buttons" (don't ask me why it's called a "radio button" when it's not a button). Now see this creates a problem when you are talking about a check box, and the only check box related to this hack is the one that makes a thread a news item, so that's what I think you are talking about. Please understand, I don't mean this as an attack against you, I just mean this as helpful advice, to create better understanding.

You can send me a copy through email (do not attach it to a message here!) of your usergroup.php file to webmaster@jjr512.com and I will see if I can figure out what's out of whack. Also, include in the email a copy of the structure of your usergroup table (just the structure, not the data!).

I'd still like to hear from anyone else that has installed this hack if they have or have not had this problem... I know some people have installed it, and since I'm not hearing any other complaints, I'm assuming it's working fine for everybody else; I just want to be sure.

The Realist
12-19-2001, 07:08 PM
On it's way to you.

;)

sianews
12-19-2001, 09:36 PM
Any estimate on when you'll have the URL feature added?

JJR512
12-19-2001, 09:51 PM
Soon! Within a day.

The Realist, I'm having trouble replying to your email...I'm getting return error messages, saying my email cannot be delivered.

floleb7
12-19-2001, 10:27 PM
the count of #comments doesn't work i test on your forum test and in news page i see 0 comments

JJR512
12-19-2001, 10:36 PM
Really? It worked fine for me:

http://www.jjr512.com/testvb/attachment.php?s=&postid=16

Which thread did you reply to?

floleb7
12-20-2001, 12:16 AM
yes when i add my post there isn't any comments but now i see 1 comment so strange :p

JJR512
12-21-2001, 03:13 AM
Just to let you all know, I am still working on the next version of this. I would say I'm about 2/3rds done.

In the meantime, anyone that has already installed the existing version, you can delete the field "summary" from the thread table. It isn't used at all, and I don't know how that part got in there! :o

sianews
12-22-2001, 01:32 PM
Any news on the next release?

bigmattyh
12-22-2001, 09:28 PM
[QUOTE]In the meantime, anyone that has already installed the existing version, you can delete the field "summary" from the thread table.

JJR512
12-23-2001, 12:00 AM
There is no summary feature. It's not part of the existing hack or the planned update to the hack; it was just one way I thought I was going to do something, then I decided to do it a different way, and forgot to take it out of the instructions.

Dockaych
12-23-2001, 03:28 PM
I installed this hack, and I really like it. However, I have encountered some problems.

1. It seems to include the Admin forums on the sidebar. I would like to have some control as to elliminated certain forums from the latest posts.

2. The script right now seems to ignore my custom icons completely. Is there way to make these work?

3. I would really like an option to 'cut off' my news articles. Is there any way we could include a [snip] tag on the article and that would cut off the article right there (manually, rather than after X paragraphs).

JJR512
12-23-2001, 06:55 PM
1. I'll be sure to fix it so it excludes forums a user does not have permission to view in the next release. (Does it do that with the main news, too?)

2. Are your custom post icons named the same way as the standard icons? In other words, with the file name being "iconx", where x is a number?

3. The next release will include a way to let you change what shows up in the news page, so that it does not have to be a direct copy of the thread's first post. So if you wanted to post an entire article to start the thread, but trim it down to the first two or three paragraphs for the news, you could do that, or if you put your articles in quote tags for threads but don't want the quote tags for the news, you could do that. Basically, when you submit a thread that you've checked to be a news item, you will be taken to a new form with a copy of the thread's first post (what you just typed out), where you can make separate edits to the message body to control what appears on the news page.

sianews
12-23-2001, 07:09 PM
There will be an option to not have the summary - just the headline - show up, right?

And will the URL field be in the next release?

sianews
12-26-2001, 12:24 AM
Any update? I'm a little anxious in case you can't tell :).

JJR512
12-27-2001, 07:45 AM
I have the basic functionality of the new version working, I'm pretty sure. I still have some details to clean up, such as a way to edit a news item now that news items are stored separately from the thread/post. But I am about to go to bed now, and I would like for some people to test out the new version on a basic level, in case there's something I've missed that doesn't work right.

Let me briefly re-explain how the new version works, first of all.

The old version simply looked in the thread table for threads marked as news items, then found the first post for the thread and got the message body from that post and re-displayed it on a separate page, the news page. What was shown as the news item was always whatever was in the first post of a thread marked as a news item. What I didn't like about that was that for the thread (as seen the normal way in the message board), I might want to post the entire news article that I've copied from some other site, but for the news item (what shows up on the news page), I might only want one or two paragraphs to show up. Just an excerpt, to keep things brief.

Now I could have easily set it up so the news page only shows the first 500 characters, or some other number you choose, of the message body from the thread's first post. But this can throw off bbcode parsing, for example if the 500 characters ends in the middle of a vB code tag. I could just not bbcodeparse what goes on the news page, but then we lose the nice formatting that imparts. Another added bonus is that with the new way I am introducing here, you aren't limited to the first 500 characters; sometimes the second and third paragraphs are better to put on a news page, because the first few lines might just be sub-headline stuff you don't need there. This new method I am introducing here gives you much more flexibility, as you are about to see.

So what is this new method? Well, I described it in my previous post, but I'll reiterate. Basically, when you start a thread and check the box to make it a news item, now what will happen is you will go to a new page which looks a lot like the new thread or new reply page. This page will have the subject (or "headline") and message (or "article") areas already filled with the subject and message you already typed out in the new thread page. But this is where the magic is...you see, you can now edit what is in those areas, to make it different from what shows up in the thread as seen in the message board. What you leave here will show up on the news page. You don't have to make any changes, if you don't want to; you can just leave it as it is, and click the Submit button again, what goes on the news page matches what goes in the thread. But you can change it, you can shorten it, you can remove or add vB Code tags, whatever. If you really wanted to, you could even completely change the text; I don't know why you would want to, I'm just illustrating the independence of the news item from the thread.

Please go here: http://www.jjr512.com/testvb/index.php and test it out. Start a new thread (unregistered users should still have Super Moderator abilities), be sure to check it as a news item, and submit it. Then you see the new form; go ahead and change it, just so you see. After you submit the new form, you get taken to the news page; see how it has whatever you left in the previous form, before you submitted it. Then click the link that takes you to the thread, and see how it still has whatever you originally started the thread with, before you changed it for the news page.

I think all I have left to do is make a way for you to be able to edit the news item (what you see on the news page). Do not bother to do the Edit Thread process, because that now is not involved (the "is news" check box is still there, but that isn't used anymore, I just haven't taken it out yet).

Also, to sianews: You will notice the URL field is there on the new form. So yes, that feature will be there. But so far, I haven't fixed the template so it shows up on the news page yet, but rest assured, it will be there; that's just a cosmetic fix now, since the structure is set up for it.

So please go try it out and let me know what you think. I have to make that edit method I just mentioned, I have to fix back the Edit Thread screen, I have to add that URL field to the news page, I have a few other minor things to put back on the news page, like the nav links...if there is anything else I need to do, let me know.

Once I get those details worked out, I will re-release this hack. But I already have plans for the NEXT release: making it multi-page ready, so you aren't just limited to a hard number of news items, but rather to a number of news items per page, with a "next page" link that takes you to the next xx oldest news items. I also would like to add some type of search feature, that would search through the news items themselves. But we'll worry about these things later; let's focus on what we have now, see that the basic idea works OK, then I'll get those other details taken care of and we'll have us a new release in the next day or two. :)

Dockaych
12-27-2001, 09:14 AM
I just tested out your system, and I have to say... it's a little strange. I completely understand how it works, but to me it just seems to overly complicate things!! The advantages of using a forum based news system over something like Newspro are that what will appear on the news listings will be exactly the same as the thread. Your system seems to introduce a completely new and seperate news management system (you will have to have archiving, news editing abilities, etc etc).

I'm not belittling the time and effort you've put into this, I'm just giving my genuine impressions of it.

Personally, I would have preferred to see something more intuitive and frankly less complicated, such as the option of news specific tags in the post, such as This is the summary which will appear on the news page, but will be hidden in the forum. Anyway, this is just my opinion.

The system you have is quite powerful I just hope that it's increased complexity doesn't cripple it's simplicity.

JJR512
12-27-2001, 06:26 PM
I understand what you're saying. As with many things, there are multiple ways to accomplish the same overall basic result, and each way as its own set of advantages and disadvantages. I considered some choices and decided on what I felt was best for me; this hack is primarily for me and my own board. I just put it here in case anybody else, after considering what it does and how it does it, decides that this is right for him/her and his/her board, too. :)

But you seem to have uncovered a bug in my system...I'm assuming that you signed a news post with "dock" in bold. Then you deleted the original thread. As it is now, deleting the thread has no effect on the news item, and the news item relies on the threadid to get the forumid, and if the script can't get a forumid, it causes a database error.

I guess what would make the most sense here is for me to fix it so that when a thread is deleted, a news item with the same threadid also gets deleted. In other words, if you delete a thread, any news item from that thread also gets deleted. Anyone have any thoughts on that?

TheComputerGuy
12-29-2001, 01:16 PM
I love this hack, and want to install it but all I get is this error

Database error in vBulletin 2.2.0:

Invalid SQL: INSERT INTO post (postid,threadid,title,username,userid,postcount,d ateline,attachmentid,pagetext,allowsmilie,showsign ature,ipaddress,iconid,visible,hidden) VALUES (NULL,'637','','TheComputerGuy','8','1009638606',' 0','thats cool','1','1','206.42.40.97','0','1','0')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Saturday 29th of December 2001 10:10:06 AM


I even took a brand new copy of newthread.php and edited it

JJR512
12-29-2001, 07:44 PM
It looks like you've done something with an "insert into post" query. My hack doesn't have anything to do with a query like that. I think you've edited in the wrong place.

I don't know how or why, but it looks like the postcount value is missing from this query. In the field names, postcount comes in between userid and dateline; in the values part, it goes right from 8, which I assume is more likely to be your userid and not your post count, to 1009638606, which is a dateline value. (Or if that is your postcount, then it's the userid value that's missing.)

TheComputerGuy
12-29-2001, 09:41 PM
I will get a new copy of Vb and insert ur hack first...sorry for taking ur time up, but thanks for the hack

JJR512
12-30-2001, 08:28 AM
I believe I have completed the functionality of the new release. There are a few cosmetic things to tidy up, I still have to display the source URL, but basically, it's done.

I would like some more testing/input before I wrap it up as a release...I'll wait a day or two before releasing it.

There are now methods to edit and delete news items, as well as create a new news item based on a thread that wasn't previously a news item.

To edit, click the edit link on a news post's dateline; this will take you to a screen just like an edit post screen. It has the familiar Delete bit at top, and the message below. It works exactly the same way as editing a post.

To make a new news item after you have already posted the thread, simply copy the URL to the thread, then click the link on the news page above all the news items that says, "Create new news item," and copy the URL into the appropriate field on the next screen. This is similar to vBulletin's Merge Threads funtion, the way the screen works. Just put in the URL and submit it; you are then taken to the same screen to edit your news item that you would see if you had done it the normal way, by submitting a new thread and checking the Make News Item box.

Please note that deleting a news item has absolutely no effect on the thread it was based on. However, deleting a thread will delete any news item based on it.

Test board: http://www.jjr512.com/testvb/index.php?s=

JJR512
01-01-2002, 05:27 AM
OK, everything seems to work fine, so I'm going to release it now.

For the record, about Dockaych's issue of private forums being shown: I have added a permission-checking system so that any particular user will only see headlines and news items from forums he/she is able to view. This means an Admin will see headlines from admin forums, whereas a regular member will not. To test this, just post something in a private forum, see that you can see it, then log out, and see that you can't see it.

Please let me know if you have any problems with my installation directions or the hack itself.

If you have already installed the previous version, I highly recommend completely uninstalling it before installing the new version. This includes all database modifications, because they are not used by this new version.

EDIT: This hack has been updated; the latest version is here: https://vborg.vbsupport.ru/showthread.php?postid=210456#post210456

slideboxer
01-01-2002, 07:02 AM
Awsome, I've been dying to set this up on my board but have been waiting for the release. Thanks, and great job!

slideboxer
01-01-2002, 07:37 AM
At the risk of sounding ignorant let me ask this...

The instructions involve creating a new table in the sql database. How do I go about doing this? :stupid:

JJR512
01-01-2002, 07:43 AM
Do you have access to a tool like phpMyAdmin, or can you telnet into your account?

slideboxer
01-01-2002, 07:44 AM
Got the telnet... Have to check on that tool, though.

JJR512
01-01-2002, 07:48 AM
I'm not exactly sure how to run queries via telnet, but maybe someone else can look in the instructions to see what needs to be done, and tell you exactly how to do it via telnet.

slideboxer
01-01-2002, 08:03 AM
OKay, I went and found and installed phpMyAdmin.. now what? :stupid:

JJR512
01-01-2002, 08:12 AM
Well, you select your database on the left side (if you have more than 1), click it to open the list of all the tables, then on the right side below the list of tables is a box that says Run SQL query/queries etc. Copy the query into that box and hit Go.

Don't forget to make a backup copy of your database first. You can do that through the admin cp.

slideboxer
01-01-2002, 09:08 AM
I'm so proud of myself :D Got it up and running, no bugs, no problems. Thanks ofr your tie and help.

The Realist
01-01-2002, 09:42 AM
Well done M8, Im glad you finaly have it up and running, especialy from the first version and problems you had.

One thing I like you have done and I hope all other hack makers take note of this is the fact that you state this in your instructions I QUOTE "Near the end of the line, before WHERE, right after "$cangetattachment", add this" in other words, other hacks ask you to totaly overwrite lines and therefore screw previous hacks up, you have asked users to add line rather than overwite.

Nice one.

Congrats M8.
;)

JJR512
01-01-2002, 09:53 AM
Yeah, that was how I wrote the instructions originally (to overwrite the entire line), and that's what gave you the problems that you had earlier. It was 100% because of that which made me try to figure out a better way to write the instructions.

Most of the rest of the file modifications are just additions, not modifications of existing code, but there is one part that goes into newthread.php that modifies what's already there, and this will interfere with another hack...I know this because I wrote the other hack, too! It's the one that gives you a different redirect message for if you post a non-poll thread or a poll thread. You kind of have to look at what both hacks want you to do if you want them both to work...or I guess I will post what I, personally, am using on my board to solve it, if anybody needs me to.

Speaking of polls, there is still one thing that I haven't tested with this hack yet, and that's what happens when you check both to make a thread a poll and a news item. I know something not right is going to happen, because both polls and news items involve redirecting you to a different page after the thread gets posted. Either it will take you to the poll setup screen and you'll have to create the news item manually, or it will take you to the news item setup screen and not only will there be no poll in that thread, but it might not be visible, either, because when you check that poll box, the thread isn't made visible until after you setup the poll. I still need to look at this issue, see what happens, and figure out what to do about it. In the meantime, I suggest that nobody try to create both a poll and news item thread at the same time.

TheComputerGuy
01-01-2002, 01:29 PM
YAY...

This hack is AWESOME!!!

TheComputerGuy
01-01-2002, 01:51 PM
on homeindex.php line 29 it states
$editlink="<a href=\"http://www.jjr512.com/testvb/newspost.php?s=$session[sessionhash]&action=editnews&newsid=$gnresults[newsid]\">(edit this news item)</a>";

That needs to be edited for your site....

Other than that...maybe I missed the instructions for this great hack, as I waited for this version to come out!

slideboxer
01-02-2002, 01:08 AM
Is there a way I can call the news from another page, a non-vb page?

JJR512
01-02-2002, 04:13 AM
slideboxer, possibly, but I'm not sure what the results would be if you just used a simple include statement...you might need to reformat the templates.

***

After having this hack in operation for a day or so on my real board, I've fixed a few minor little details that escaped me earlier. Most critical, though, is an entire group of instructions that I forgot to include, that without doing, would leave some of the features of this hack unusable. This section of the instructions adds settings to your Admin CP (in the vBulletin Options section as a new group of settings) that allow you to turn on or off vB Code support in news items, the img tag, post icons, etc. It also allows you to set the maximum length of an article, as well as how many appear on the page.

Because there were some minor modifications to the two main code files (newspost.php and homeindex.php), I have attached a new ZIP file to this post. If you have already installed the second version of this hack (posted a day ago), please upload the two main files, and follow Part 5 in the Instructions (the first four Parts are the same and can be skipped). If you have installed the original version (from the first post), please uninstall it by reversing the directions, then just start with the new version from scratch.

EDIT: Hack updated; see Post #69

The Realist
01-02-2002, 09:28 AM
How can I make a already made post a news Item, I see the option when you first make a post but when I go and edit a post an option is not there?

Other than that, great hack.

Owe, the second part worked well.

JJR512
01-02-2002, 04:18 PM
On the news page (homeindex.php), to only people that have permission to post news, there should appear a link that says "Create New News Item" just above the list of news items (just above the first item). You should copy the URL to the thread you want to make a news item from, then click that link, and paste the URL into the form. From there, the process is just like if you did it when you posted the thread. Please note, this only allows you to make a news item from the first post in the thread...this is a limitation that just ocurred to me, and something I may work on for a future version.

The Realist
01-02-2002, 05:25 PM
Regarding the below, Ummmmmm NO!

I dont know if Im doing something wrong but the link "Create New News Item" does not appear (see attached pic)

????? Lost

:confused:


[QUOTE]Originally posted by JJR512
On the news page (homeindex.php), to only people that have permission to post news, there should appear a link that says "Create New News Item" just above the list of news items (just above the first item).

slideboxer
01-02-2002, 05:29 PM
I'm having the same problem. No linkie :(

JJR512
01-02-2002, 07:34 PM
In homeindex.php, please find:

$permissionssql=$DB_site->query_first("SELECT canmakenews FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
$permissions=$permissionssql[canmakenews];
if ($permissions==1) {
eval("\$showcreatelink = \"".gettemplate("main_news_showcreatelink")."\";");
} else {
$showcreatelink="";
}
And change this to:

$permissions=$DB_site->query_first("SELECT canmakenews FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
if ($permissions[canmakenews]==1) {
eval("\$showcreatelink = \"".gettemplate("main_news_showcreatelink")."\";");
} else {
$showcreatelink="";
}
Also, please make sure that you installed the template main_news_showcreatelink with the contents from the text file of the same name, and that your usergroup permissions are set to allow posting news items.

The corrected homeindex.php is also in the ZIP file in the previous attachment.

The Realist
01-02-2002, 08:06 PM
main_news_showcreatelink

I cannot find this template in my downloaded version?

JJR512
01-02-2002, 08:39 PM
OK, sorry about that! That was a change I made to homeindex.php, to use a template for the link rather than having it hardcoded in the file. But I forgot to include the new template.

The new template is in the attached ZIP. Please add the new template, also please UPDATE the template main_newindex because it has changed as well (I moved the link to below the news items rather than above it, for cosmetic reasons; you do not have to make this change if you'd rather have the link above). May as well also re-upload the two .php files, too.

UPDATE: This hack has been updated, as mentioned below in Post #81, where the attachment is now located.

The Realist
01-02-2002, 09:32 PM
I have another problem.

When I say yes to "Can post news items" the option called "Can post news items" changes to No and does the opposite if I say No it chages to yes.

Is this suposed to happen?

Also the option "Can post news items" never stays ticked when saved.

Strange?

:confused:

JJR512
01-02-2002, 09:38 PM
You must have something backwards in your usergroup.php file...I'll take another look at it for you, if you want.

The Realist
01-02-2002, 09:46 PM
Sent email asking for your addy M8.

Thanks again.

Brian

[QUOTE]Originally posted by JJR512
You must have something backwards in your usergroup.php file...I'll take another look at it for you, if you want.

JJR512
01-02-2002, 10:27 PM
Your direct email address doesn't seem to be working...so: webmaster@jjr512.com

JJR512
01-02-2002, 11:33 PM
I have the file fixed for you, but am unable to send email to either of your two addresses; they're getting returned.

The Realist
01-04-2002, 01:14 AM
Sorted the templates out and all seemed fine. I started to install a few news pages for members and in fact did 8 all 100%.

Here: http://www.skytronic-forums.com/homeindex.php

The problem I have now is it will not let me enter a 9th news post, coming back with a mysql error:

Database error in vBulletin 2.2.1:

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

Date: Friday 04th of January 2002 03:13:35 AM
Script: http://www.skytronic-forums.com/newspost.php
Referer: http://www.skytronic-forums.com/newspost.php?s=&action=makenewnews

And now regardless of what post I try it comes back with the same error?

:confused:

JJR512
01-04-2002, 05:20 AM
1. How were the first eight news items created...did you do it when you posted the threads, or afterwards using the Create New News link and a pre-existing thread URL, or a mix of both methods?

2. Which method were you using when this error first ocurred?

3. Does the method now happen all the time, regardless of which method you use, or are you able to post news items one way but not the other, and if so, please say which method works and which doesn't.

The Realist
01-04-2002, 10:25 AM
[QUOTE]Originally posted by JJR512
1. How were the first eight news items created...did you do it when you posted the threads, or afterwards using the Create New News link and a pre-existing thread URL, or a mix of both methods?

slideboxer
01-04-2002, 01:00 PM
Also getting an error when posting polls. I added the following code to newthread.php

// redirect
if ($postpoll) {
$goto="poll.php?s=$session[sessionhash]&threadid=$threadid&polloptions=".intval($polloptions);
} elseif ($visible) {
if ($makenewsitem) {
$goto="newspost.php?s=$session[sessionhash]&action=createnews&threadid=$threadid";
eval("standardredirect(\"".gettemplate("redirect_postnews-create")."\",\"$goto\");");
} else {
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";
eval("standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
}
} else {
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$forumid";
eval("standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
}
}
}
}

As per instructions but when I post a poll in the forums I get the standard "You will now be redirected, etc...) message and then the screen goes blank and sits at newthread.php

JJR512
01-04-2002, 07:21 PM
The Realist, after the last time the link worked for you, but before it stopped working, did you do anything like re-upload the files, apply any other hacks, etc.? Just trying to figure out what would cause it to suddenly stop working, so I know where to look to fix it.

slideboxer, yes, it does not work with polls right now. I already pointed that out, and said that for now, you probably shouldn't check both boxes at the same time.

The Realist
01-04-2002, 07:27 PM
No........

I was posting news and finished the 8th post and it would not let me do the 9th, thats it?

Simple!

:)


[QUOTE]Originally posted by JJR512
The Realist, after the last time the link worked for you, but before it stopped working, did you do anything like re-upload the files, apply any other hacks, etc.?.

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:$gnpagetext=bbcodeparse($gnpagetext);After this line, insert the following 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!

JJR512
02-13-2002, 06:20 PM
Sorry, please ignore the test forum for now. If you want to see the hack in action, please look at it on my production forums: http://forums.jjr512.com/homeindex.php

(This hack on the test forum is not currently working due to being in the middle of testing of something that isn't finished yet.)

squawell
02-13-2002, 06:29 PM
so u mean the hack didn't finish yet~~

and i got that is normal!!

pdaGuy
02-13-2002, 07:09 PM
JJR512,
I'd like to suggest something...
Wouldn't it be better if the "Headbits" didn't show the threads that are "News Items" too? I mean, what's the point of showing them in two places on the same page? What do you think?

P.S. Any idea on the include statement? (see post #119 (https://vborg.vbsupport.ru/showthread.php?postid=220097#post220097))

JJR512
02-14-2002, 01:37 AM
[QUOTE]Originally posted by squawell
so u mean the hack didn't finish yet~~

and i got that is normal!!

pdaGuy
02-14-2002, 01:53 AM
JJR512,
Thanks for considering my request and I look forward to see what you?ll come up with on the new version ;)
Is there any chance that you or someone else could let me know how to insert extra PHP code on the homeindex.php page?
For example, I want to include a separate Poll script that I found here (http://www.proxy2.de/), but the installation instructions say that I must add the following in order to have the Poll on my site.

[QUOTE]
<?php require "./booth.php"; ?>
<?php
echo $php_poll->poll_process(1);
?>

JJR512
02-14-2002, 09:22 PM
You cannot add PHP code to templates. (Unless it's the phpinclude template, of course.) You must add the code to the file; in this case, homeindex.php file.

Because the file is entirely PHP to begin with, you can strip the PHP opening and closing tags, so you are left with these two lines:
require "./booth.php";
and
echo $php_poll->poll_process(1);

Without having read the instructions for that hack, I would assume you should put the require line below the line that requires global.php, and the echo line...well, I don't really know where to stick that, honestly. I think an echo statement will work in this file because all the HTML is generated by templates, and the output of the echo statement would need to go wherever in the HTML that you want it, which isn't possible this way. I think wherever you stick that echo statement in the homeindex.php file, the output will just end up at the top of the page, above the header and everything.

pdaGuy
02-15-2002, 02:38 AM
Well.... I did what you said but it didn't work :(
When I added the echo... I received
[QUOTE]echo (0);

pdaGuy
02-16-2002, 12:05 AM
Just so you know.. I find out how to include the poll script ;)
Everything needed to go on the phpinclude ;)

voogru
02-21-2002, 05:41 PM
i want to be able to include the news hack on my non-vB page this is how i have it setup

main site is in the public_html/ folder
and my forums are in the public_html/forums/ folder

now what i want to do is simply modify my index.php to get the news and make working links to the posts. i dont know how to include it and keep my normal page up.

basicly heres what im looking for, this is a IMAGE EDIT just for your info :)

http://www.voogru.com/images/homepage.jpg

i attached my index.php if someone could lead me in the right direction that would be great :)

-voogru

TECK
02-22-2002, 03:34 AM
i posted here on this thread how to make homeindex.php your home page. ;) search through..

timbob
03-03-2002, 07:17 AM
Is this wonderful piece of software ready for full release yet?

ForKmaN
03-03-2002, 08:37 AM
Ok I want this hack..exactly which link do I get :P

is it fully out yet?

juno
04-05-2002, 08:37 AM
JJR512,
Could you send me the latest version? I'd like to try and convert this over to vbportal.

John
04-06-2002, 12:40 AM
I'm confused. I can't access newspost.php because I don't have the rights - even though I'm the admin (of course). And homeindex.php is nice, there's a news bar down the right hand side. But isn't something supposed to go in the middle?

<newbie>

Help?

Okiewan
04-10-2002, 01:06 AM
[QUOTE]Originally posted by nakkid
i posted here on this thread how to make homeindex.php your home page. ;) search through..

wintz
05-13-2002, 04:36 PM
Can anyone let me know if/where i can get this hack or one that dose the same thing it`s just what i have been looking for thanks

Lionel
06-30-2002, 03:13 PM
if there is an image as attachment is there a way to also have it displayed on homeindex, as a thumb, using php resize function?

BigJohnson
07-15-2002, 09:06 AM
I can't get this to work for my site. My board is at www.website.com/forums/
and i want to put the homeindex at www.website.com

Not at /forums/

How would i go ahead to do this. Can someone please tell me in detail because i am not to good at this. Thanks

JJR512
07-15-2002, 06:21 PM
I know I've never been able to get it to work outside of the forums directory, and I don't recall anyone else saying they did it, either. So that's where I kept it. At first, I changed my root index.html to instantly redirect to homeindex.php. Eventually, I just moved my entire forums to the root web level.

Lethal
07-16-2002, 05:43 PM
does this work on vb 2.2.6?

JJR512
07-16-2002, 06:40 PM
It should. It does for me, and I don't remember having to modify it.

Lethal
07-17-2002, 04:25 PM
thank you

Lethal
07-18-2002, 06:39 PM
This is a great hack. I have a little problem. I have 5 different sections in my site and each of them have a different news forum. Is it possible to use this hack and have the news from each news forum show up and their respective index pages. Meaning I will need to have basically a different homeindex.php for each index page. Is something like this possible for this hack? Also, why is the news posted on the right sidebar and not in the middle? I hope this is possible to do this. Maybe not with this hack but maybe there is another one here that I haven't found yet. I tried pluhnews but i didn't like that because I couldnt' get that to use the current style of my board and I had to edit it with html and what if I have a different style then the colors won't match and stuff like that. Help please.

Tarion
07-18-2002, 08:24 PM
i think i found a Bug:

when i make a new thread, mark this thread as news and would start a poll, i got a with page, i fgured it out that the poll function now work but only when i don't try to do both makr as news and start a poll.

Any idears or is this only my problem???

I use VB 2.2.4

BigJohnson
07-19-2002, 03:04 AM
I get this as an error please help

Warning: ChDir: No such file or directory (errno 2) in /usr/local/psa/home/vhosts/url.com/httpdocs/index.php on line 6


[QUOTE]Originally posted by Nakkid
01. open homeindex.php. place:chdir("/home/yoursite/forum");
above:require("./global.php");
02. find:$editlink="<a href=\"newspost.php?s=$session[sessionhash]&action=editnews&newsid=$gnresults[newsid]\">(edit this news item)</a>";and add in front of it your site location:$editlink="<a href=\"$bburl/newspost.php?s=$session[sessionhash]&action=editnews&newsid=$gnresults[newsid]\">(edit this news item)</a>";

03. replace all { imagesfolder } code with your actual folder location (http: //www.yoursite.com/forum/images) or simply edit the imagesfolder variable to point to the full url.

04. find:$pagenav = getpagenav($totalnews,"homeindex.php?s=$session[sessionhash]&perpage=$perpage");and replace the homeindex.php with the name of your file, for example index.php.

**************************
01. open newspost.php. find the code:eval("standardredirect(\"".gettemplate("redirect_postnews-done")."\",\"homeindex.php?s=$session[sessionhash]\");"); and replace homeindex.php with the url of your main page (or use the variable $homeurlindex.php). this will make it look like:
http: //yoursite.com/index.php

02. find:eval("standardredirect(\"".gettemplate("redirect_editnews")."\",\"homeindex.php?s=$session[sessionhash]\");");and replace homeindex.php with the url of your main page (or use the variable $homeurlindex.php).

03. find: if ($deletenews=="yes") {
$DB_site->query("DELETE FROM news WHERE newsid='$newsid'");
eval("standardredirect(\"".gettemplate("redirect_deletenews")."\",\"homeindex.php?s=$session[sessionhash]\");");
} else {
eval("standardredirect(\"".gettemplate("redirect_nodeletenews")."\",\"homeindex.php?s=$session[sessionhash]\");");
}and replace homeindex.php with the url of your main page (or use the variable $homeurlindex.php).

BigJohnson
07-20-2002, 01:00 PM
Can someone please help me. Read above. PLEASE@!!!!!