Jump to content

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>";
   }  ?>

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.