Jump to content

Questions on Making a blog system...


dannyluked

Recommended Posts

Hi,

I have just made a blogging system for my site and would like it to work like another site (http://www.wiganwarriors.com/). These are my questions:

 

1. How do I limit the number of characters from a query so when It show the main writing in the blog it only shows 100 characters and after links to the rest of the writing? This is what I have so far (by the way this is in a div with queries before and after);

$qry[writing]<a href='http://MYSITEHERE/blogtemplate.php?id=$qry[id]'>[more]</a>

 

2. How do I made the most recent blog show up big (like in the website above) and the next 3 most recent smaller and so on?

 

Any good answers would be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/
Share on other sites

OK, I dont understand what some of the posts mean, I am a beginner so I will paste the code and could you please rewrite the code to back up your suggestion:

 

<?php
   include "config2.php"; 
   mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
   $result = mysql_db_query($database, "select * from $table WHERE id = '".$_GET['id']."'") or die (mysql_error());
   while ($qry = mysql_fetch_array($result)) {       echo "<div class='blog' id='blogcontent'>  <div class='Blogcontent' id='title2'><span class='title'>$qry[title]<span class='date'> - $qry[date]</span></span></div>   <div id='divLeft'><a href='$qry[image]'><img src='$qry[image]' width='100' height='100' border='0' /></a></div>  <div id='main'><span id='main'>$qry[writing]<a href='http://dannyluked.comze.com/template2.php?id=$qry[id]'>[more]</a></span></div>  <div id='link'><span class='style51'>Link:</span> <a href='$qry[link]' class='linker' target='_blank'>$qry[link]</a><br />  </div></div>";
   }  ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.