![]() |
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. |
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 |
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 for an example. krishmandal - Maybe you'd get what you want if you took the time to search for it -jim |
Quote:
Will post here when I finished. But, I am a newbie to PHP ! |
This does exactly what you are asking about.
http://www.vbulletin.com/forum/showt...?threadid=1384 -jim |
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. |
Quote:
Thanks for you help, but, I really didn't see what I want there, where is the news ? |
Quote:
You insert that code into your page. You create the news. That code displays the news on your front page. It's easy. -jim |
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; } } ?> |
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. |
All times are GMT. The time now is 04:55 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|