dannyluked Posted June 13, 2009 Share Posted June 13, 2009 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 More sharing options...
jxrd Posted June 13, 2009 Share Posted June 13, 2009 1. substr 2. something like this $style = (!isset($style)) ? 'style="font-size: 2em;"' : ''; echo '<div '.$style.'....and so on Link to comment https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/#findComment-855047 Share on other sites More sharing options...
Hybride Posted June 13, 2009 Share Posted June 13, 2009 2 - add limits to the database query to get a specific amount of blogs (ie: LIMIT 4) Link to comment https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/#findComment-855052 Share on other sites More sharing options...
dannyluked Posted June 13, 2009 Author Share Posted June 13, 2009 2 - add limits to the database query to get a specific amount of blogs (ie: LIMIT 4) I cant because then it will still display them just like a normal blog not a 'Recent' blog! Link to comment https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/#findComment-855054 Share on other sites More sharing options...
dannyluked Posted June 13, 2009 Author Share Posted June 13, 2009 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>"; } ?> Link to comment https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/#findComment-855069 Share on other sites More sharing options...
fenway Posted June 15, 2009 Share Posted June 15, 2009 I have no idea what you want. Link to comment https://forums.phpfreaks.com/topic/162047-questions-on-making-a-blog-system/#findComment-856468 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.