PDA

View Full Version : What's new


09-05-2000, 06:05 AM
I wonder if this kind of hack is already there, please make one if not.

1. We create a board that is only allow users to read.
Only moderators can post. And we post "news" just like post a new thread.
2. Auto. list newest 5 "news" threads on the frontPage , and shows only Topics,20 words of content. and a [more] links to the VB threads.

09-05-2000, 01:52 PM
This is exactly something I was asking for on another thread in this forum topic. Maybe we'll get what we want soon if enough people find it useful.

Krish

09-05-2000, 02:25 PM
That's already out there.

You can make any forum read only to members. And there is a hack that I *kind of made* that lists the x most recent topics posted. See my main page (http://www.bronx-bombers.com/) for an example.


krishmandal - Maybe you'd get what you want if you took the time to search for it

-jim

09-05-2000, 03:02 PM
Originally posted by krishmandal
This is exactly something I was asking for on another thread in this forum topic. Maybe we'll get what we want soon if enough people find it useful.

Krish

I am making one right now, and it is almost done.
Will post here when I finished.
But, I am a newbie to PHP !

09-05-2000, 04:22 PM
This does exactly what you are asking about.

http://www.vbulletin.com/forum/showthread.php?threadid=1384

-jim

09-05-2000, 10:38 PM
I look forward to your hack James.
I am too new to PHP and MySQL to do anything worthwhile right now, otherwise I'd try it myself. Best of luck, I'm rooting for you.

09-06-2000, 01:03 AM
Originally posted by JimF
This does exactly what you are asking about.

http://www.vbulletin.com/forum/showthread.php?threadid=1384

-jim


Hi!
Thanks for you help, but, I really didn't see what I want there, where is the news ?

09-06-2000, 01:08 AM
Originally posted by JimF
That's already out there.

You can make any forum read only to members. And there is a hack that I *kind of made* that lists the x most recent topics posted. See my main page (http://www.bronx-bombers.com/) for an example.

-jim

I may be totally dillusional here, but this is what you want. Take a look about halfway down my front page on the right.

You insert that code into your page. You create the news. That code displays the news on your front page.

It's easy.

-jim

09-06-2000, 03:03 AM
First, your Frontpage that you want to put the What's new on, should be a .php or .php3 file.
On that page , put this on:

<table border="0" width="55%">
<tr>
<td width="70%"><font color="#008000">Your What's New News System Title</font> </td>
<td width="30%"><A HREF="http://yourdomain/forum/index.php3?categoryid=1" target="_blank">Total x records</A></td>
</tr>
<tr>
<td width="100%" colspan="2"><HR NOSHADE="TRUE" ALIGN="LEFT" SIZE="1" COLOR="#CCCCCC" >


<?php

require("callnews.php3");

?>
</tr>
</table>

Then, upload this callnews.php3 file to the same directory :

<?
########what this file do: pull categoryid=1 's data to frontpage
$x=2; //How many news you want to display ?
require("/your/path/to/admin/config.php3");
$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);
$query = "SELECT * FROM thread where forumid='1' ORDER BY lastpost DESC ";
$result = mysql_query($query,$db);
$y=1;
while ($news_array = mysql_fetch_array($result)) {
$query = "SELECT * FROM post where threadid=$news_array[threadid] ";
$result2 = mysql_query($query,$db);
while ($post_array = mysql_fetch_array($result2)) {
$show_brief = substr($post_array[pagetext],0,20);
$post_time = date("Y-m-d h:i A",$news_array[lastpost]);
}
echo "<p style=\"margin-left: 10\"><img border=\"0\" src=\"http://www.dell.com/images/global/contentnav/content_action.gif\" width=\"17\" height=\"17\"><font size=2 color=blue>$post_time </font><A HREF=\"http://yourpathto/showthread.php3?threadid=$news_array[threadid]\"><font size=2>$news_array[title] </font></A><br> <font size=1>$show_brief...</font> <font size=1>views:$news_array[views]</font><br>";
$y++;
if ($y > $x){
break;
}

}

?>

09-06-2000, 04:27 AM
James,

Great job. Right on the money. There were a few tweaks I had to do for my own forum, since I didn't leave it with the standard /forum/ directory, and I had to adjust the forum number, etc., but it works, and it works well. It's exactly what I was dreaming of.

Now if JimF had actually TAKEN THE TIME to read what we were asking for, maybe his would work the way we wanted. But it doesn't do what yours does.

I'm really glad you posted your solution here. A million thanks man.

09-06-2000, 08:16 AM
Originally posted by krishmandal
James,

Great job. Right on the money. There were a few tweaks I had to do for my own forum, since I didn't leave it with the standard /forum/ directory, and I had to adjust the forum number, etc., but it works, and it works well. It's exactly what I was dreaming of.

Now if JimF had actually TAKEN THE TIME to read what we were asking for, maybe his would work the way we wanted. But it doesn't do what yours does.

I'm really glad you posted your solution here. A million thanks man.

I am glad I can help. I was take advertange from others for a long time, I really glad I can do something free for others. Thanks for give me this oppertunity.

11-01-2000, 03:19 AM
I get this when I call the script:

Warning: 0 is not a MySQL result index in callnews.php3 on line 10

Any help would be nice! :)

11-02-2000, 08:31 PM
Please help. Is there any more info you need? I still can't get it working :(