|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
A News Script with Multiple Pages -- In Need of one Help!
Does anyone know of a news script that gives you the option to post articles with multiple pages.
Example: News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. News article here. Next page link>>> Anyone? Thanks! |
|
#2
|
|||
|
|||
|
Do you have the database set up and a way for users (or you) to submit the articles to the database. If so, this is really really simple to do...
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
I believe mytch wrote an article about this... you might wanna do an article search on the main site.
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#4
|
|||
|
|||
|
No, I don't have nothing set up yet. I'm just looking for the right program, or perhaps a way I can do it my self.
|
|
#5
|
|||
|
|||
|
Hey, I found that article and it worked great. However, I can't get my articles to appear with the newest post on top. Know how I can get that to work? Also, I would need a script that can show the date and authors.
Last edited by banx : February 10th, 2003 at 05:51 PM. |
|
#6
|
|||
|
|||
|
Quote:
Ok - I am guessing now that you have your DB setup and everything. I am not sure how the DB/Table structure is in that article, but if you have a date field, you can use ORDER BY date DESC in your query to retrieve the results by date, with the latest being first in the result set... |
|
#7
|
|||
|
|||
|
and where do I put this?
With the script that Mytch wrote up, there's no date in the script. So when I post, it doesn't show the date of when the post was made. Last edited by banx : February 10th, 2003 at 09:59 PM. |
|
#8
|
|||
|
|||
|
Post a link to the article please so I can have a looksy at the structure. Thanks You.
|
|
#9
|
|||
|
|||
|
http://www.thewrestleholics.com/pic...howarticles.php
http://www.thewrestleholics.com/pic.../addarticle.php There it is.... You may have seen the script before. |
|
#10
|
|||
|
|||
|
I actually meant a link to the article by mitch.....
![]() |
|
#11
|
|||
|
|||
|
|
|
#12
|
|||
|
|||
|
You told me there was no date field but there is
Code:
create table articles ( articleId int auto_increment not null primary key, title varchar(250), summary text, datePublished timestamp, unique id(articleId) ); The timestamp or datePublished is a date field. Ok, where this line of code is PHP Code:
That should give you the results with the latest one first. |
|
#13
|
|||
|
|||
|
I see, thanks man I really appreciate it this.
And this will also make the date appear as well? Sorry about the constant nagging lol... but I've been looking for a script like this for nearly two years. Two more questions... Is there a way I can have the author of the post displayed? Could I have images posted with my articles? Thanks soooo much ![]() |
|
#14
|
|||
|
|||
|
Is there a way I can have the author of the post displayed?
Simply add a author field to your table, and echo it. Could I have images posted with my articles? Get yourself a fileupload class, and store the path in a field, echo that too and your done. |
|
#15
|
|||
|
|||
|
Okay. Do you know a tutorial or something that show me how to do all these things, because I'm new to all of this.
|
|
#16
|
|||
|
|||
|
Quick and dirty
first do sql: ALTER TABLE `articles` ADD `author` VARCHAR( 30 ) NOT NULL ; ------------------------------------------------------ then: add a form field to your backend html were it looks nice: <input name="author" type="text" maxlength="20" value=""> -------------------------------------------------------------- Next: Update your mysql querie @mysql_query("insert into articles(title, summary) values('$articleTitle', '$articleSummary')") or die("Couldn't add article: " . mysql_error()); to: @mysql_query("insert into articles(title, summary, author) values('$articleTitle', '$articleSummary','$author' )") or die("Couldn't add article: " . mysql_error()); ---------------------------------------------------- next: update: <font face="Verdana" size="4"><b><?php echo $row["title"]; ?></b></font><br><br> <font face="Verdana" size="2"> <?php echo $row["summary"]; ?><br><br> <a href="fullarticle.php?articleId=<?php echo $row["articleId"]; ?>">Read More...</a> to: <font face="Verdana" size="4"><b><?php echo $row["title"]; ?></b></font> <font face="Verdana" size="-1">by <b><?php echo $row["author"]; ?></b></font> <br><br> <font face="Verdana" size="2"> <?php echo $row["summary"]; ?><br><br> <a href="fullarticle.php?articleId=<?php echo $row["articleId"]; ?>">Read More...</a> ------------------------------------------------- Get the trick? If you did you can easly do the same with the date. ------------------------------------------- Note that echo "$row["datePublished"]"; wount do it. make $time=$row["datePublished"]; $date = date("F Y, l d @ H:i",$time); echo "$date"; Or format it in a other way (www.php.net ---> look up "date" ) ------------------------------------------------------------ About the images i am working on a gallerie, with upload and insert into textarea. Perhaps i#ll post that tomorrow. Perhaps because the code(wysiwyg js) i am doing wount work easly with yours. Have fun ![]() |
|
#17
|
|||
|
|||
|
I was able to add the author names, and that works great. Haven't gotten the date up but I'm working on it. Thanks for all your help. I was thinking of adding perhaps a drop down menu, which could generate the image code into the text area. Don't quite know how to go about doing that though. |