Jump to content

Help me set up my blog


Kaboom

Recommended Posts

  • :confused: :confused: :confused:
    Can someone here help me with my blog? Someone who knows PHP and stuff? I have everything but the posting and load posts codes ... so they can go to the page a try to post but when they submit it it says Insufficient Data ... I can give you a copy of the script or my cpanel data if anyone can help me make it stay so when they post it puts the post, title, poster, and date into a MySql db and make it so the index.php shows the last 25 on the first page with a next page feature at the bottom.. let explain more:
     
    The newpost.php is done, the user will go there to write a new post from the link on index.php called "Post a new article". After new post it posts data to post.php. The code from post.php is:
     
<?php include "config.php"; include "func.php"; include "english.php";

if (isset($_SESSION["user"][1], $_POST["posts"], $_POST["subject"], $_POST["contents"])) 
{
$_POST["posts"]=clean($_POST["posts"]); $_POST["subject"]=clean($_POST["subject"]); $_POST["contents"]=clean($_POST["contents"]);
if ($_POST["subject"]!="")
{
  $usr=user_($_POST["posts"]);
  if (isset($usr[0]))
   if (send_message($_SESSION["user"][0], $usr[0], $_POST["subject"], $_POST["contents"])) msg($lang['msgSent']);
} else msg($lang['noSubject']);
} else msg($lang['insufData']);
?>


 
I need that to post into the database under the table 'posts' and then in that table post the:

  • - title
  • - author
  • - CONTENT
  • - DATE AND TIME

 

After that I need then index.php to say (p.S: they need to be able to click the article title and have it load that article on article.php?article=%IDOFARTICLE%):

 

Articles

Post a new article

Article title 1 - a 80 character description here so they can see what all it is if the title doesn't explain it all trailing with...

- Article posted by AND THEN NAME HERE

Article title 2 - a 80 character description here so they can see what all it is if the title doesn't explain it all trailing with...

- Article posted by AND THEN NAME HERE

Article title 3 - a 80 character description here so they can see what all it is if the title doesn't explain it all trailing with...

- Article posted by AND THEN NAME HERE

Article title 4 - a 80 character description here so they can see what all it is if the title doesn't explain it all trailing with...

- Article posted by AND THEN NAME HERE

 

<<First <Previous      Page 1 of GET#OF-PAGES      next> Last>>

 

And that has to call the last 20 posts in the DB then go to the next page if there is more... Each index will have its own section so like a category they can pick to read or post from. Is there anyone here who can help me with this at all? Oh and in the navbar i need it to show ACP to admins only not everyone :D Each post has to go into the database for its section so if i make a category called babys then they need to post in the database table called babys :)

 

Please help guys  :D :D :D :D :D :D :D :D :D :D :D

Link to comment
Share on other sites

there is no sql query on that page. if you want to post data to the database, do something like

 

$sql = "INSERT into post (title, author, content, date) VALUES('$title', '$author', '$content', NOW())";
$query = mysql_query($sql);

//etc etc

 

the NOW() part is assuming you have one of the mysql date formats as your date field type.

 

if you have a varchar field type (which I suggest you dont) you can use the date function for your specified format and insert that

Link to comment
Share on other sites

there is no sql query on that page. if you want to post data to the database, do something like

 

$sql = "INSERT into post (title, author, content, date) VALUES('$title', '$author', '$content', NOW())";
$query = mysql_query($sql);

//etc etc

 

the NOW() part is assuming you have one of the mysql date formats as your date field type.

 

if you have a varchar field type (which I suggest you dont) you can use the date function for your specified format and insert that

Well the database is setup so it has

 

`id`

`poster`

`subject`

`content`

`date`

 

Now I need to make my post.php save whatever they just posted into the database table "babys" so kaboom_bloguse.babys and then I need the article.php to read the posts from the id so if they open article.php?id=202 it would open the 202 post made in that table.. i don't know how to make it post into a database in those fields and I don't know how to make the article to read that database post either :( Then I need to make a comment.php that when they read that article they type in a comment at the bottom and it will post that comment underneath the post... I just don't know what to do, can you guys help me? I'm coding from the ground up.

Link to comment
Share on other sites

There is about 1 million tutorials on how to do php/msyql development, not to mention books.  How about putting in a bit of effort -- it seems you have a pretty good understanding of what you want.

 

Wow and your a mod? Its called a help section for a reason, I said I need to know how to do it so either help me or stay off my thread or give an idea/link to what I should do ...

Link to comment
Share on other sites

There is about 1 million tutorials on how to do php/msyql development, not to mention books.  How about putting in a bit of effort -- it seems you have a pretty good understanding of what you want.

 

Wow and your a mod? Its called a help section for a reason, I said I need to know how to do it so either help me or stay off my thread or give an idea/link to what I should do ...

 

Here you go:  This is a link to a tutorial series I wrote some years ago. 

 

http://www.gizmola.com/blog/index.php?serendipity[subpage]=downloads&level=1&thiscat=6

 

Skip through until you get to the part that shows you how to write your post script.  It also shows how to get the data back out again, specifying an ID.  There's also a zip with source code.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.