
eatfishy
Members-
Posts
82 -
Joined
-
Last visited
Never
Everything posted by eatfishy
-
Nevermind I figured it out. I just need to change the date to military time, so that it'll calculate minutes and hours correctly.
-
I am able to calculate the difference between days and hours, but can't calculate minutes. Anyone know why I am not receiving the correct minute difference between post time and current time ? Here is my code in the main page: $createdatetime=mysql_result($communityresult,$i,'createdatetime'); $column['timeposted'][$i]=CommunityTimePostDiff($createdatetime,date('m/d/Y')); Here is my code in the function: function CommunityTimePostDiff($startDate, $endDate) { $secDiff=TimeDiff($startDate, $endDate); $absSecDiff=86400-abs($secDiff); //secs will be in negative if less than 1 day if($secDiff<0) { $hourDiff=floor($absSecDiff/3600)-1; $postTimeAgo='<div id="communityposttimeago"> '.$hourDiff.' hours ago</div>'; if($hourDiff<=0) { $minDiff=floor($absSecDiff/60); $postTimeAgo='<div id="communityposttimeago"> '.$minDiff.' mins ago</div>'; } } elseif(($secDiff>0)&&($secDiff<=86400)) { $postTimeAgo=floor( $secDiff / 86400 )+1; $postTimeAgo='<div id="communityposttimeago"> yesterday</div>'; } elseif($secDiff>86400) { $postTimeAgo=floor( $secDiff / 86400 )+1; $postTimeAgo='<div id="communityposttimeago"> '.$postTimeAgo.' days ago</div>'; } return ($postTimeAgo); }
-
I think the font size is too small, which strain my eyes and I'm only on a 17 inch monitor. I think it'll be better if the font size were slightly better, but that's just my opinion.
-
The look and feel to it website is a good vibe for HIP HOP music. If you have a music player, it'll be a good way to display the songs from these new artists. Also, many hip hop artist website have some type of graffiti on it. Pretty good site overall.
-
Please review my political social-networking site.
eatfishy replied to LawsLoop's topic in Website Critique
I thought the main page is too clustered up...maybe it could be use for the member account page. I love the icons in the website thou. -
I like the fact that I didn't have to scroll horizontal to view the website. I think the main content paragraph could use a little space padding between the design. It'll be easier to read and less strain on the eye. What do you think of my website? www.blogoberry.com
-
I created a blog website and most of the basic part is completed already. I appreciate any feedback. Thanks. www.blogoberry.com
-
I tried the code and it didn't work. It was returning ARRAY as the value. I decided to take another route around this by creating a function with the help of string position, string length, string find and string replacement to get what I need. Thanks again for the help.
-
Thanks, but it only returns weblink. Is there a way to return to the whole phrase? ex: [weblink]www.google.com[/weblink]
-
ah...is there a wild card for multi characters?
-
I thought . stands for wildcard. [weblink]www.target.com[/weblink] [weblink]www.google.com[/weblink] [weblink]www.yahoo.com[/weblink] I want to be able to use a reg expression to pick up any of the above phrases.
-
I was reading the regular expression tutorial on a few websites and I thought I understand it. When I try to code it out, I was not getting result that I needed. Below is a blog and I want to search for certain phrase: --------Start Blog----------- If you wanna learn how I create this website, you can start by reading some of the material in the below link. This is how I got started on creating website. [weblink]www.htmlcodetutorial.com[/weblink] I can show you what I know. --------End Blog------------- I basically want to search for any phase like [weblink]www.htmlcodetutorial.com[/weblink] so that I can replace it with something like this <a href="www.htmlcodetutorial.com">www.htmlcodetutorial.com</a>. I tried a few expression and it's not working. I'm concern with searching the phrase and I'll get to the replacing epression part later. $occurence=preg_match("|[weblink].[\/weblink]|", $blogcontent, $match); echo $occurence; echo $match[0]; www.htmlcodetutorial.com
-
When I received this error, it usually means that the hosting company have to do something on their side.
-
I haven't worked much with JS, so I was wondering if anyone can help me out. <?php include("Session.php"); include("Menu.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>BlogoBerry - Create your free blog or online diary</title> <meta name="verify-v1" content="XkVeFYClT7cujF+i4PkEOk07c+x03VY1uy5oRLDs8k0=" > <meta name="keywords" content="blog, blogger, online diary, social network, voice opinion, poll, contest, creative writing, free website" /> <meta name="description" content="Create a free blog, online diary, weblog, voice your opinion, view poll, meet new friends or simply call it Blogoberry!" /> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <script language="JavaScript" type="text/javascript" src="richtext.js"></script> </head> <body> <!-- start header --> <?php include("Header.php"); ?> <!-- end header --> <!-- start menu --> <div id="menu"> <ul> <table width="850px"> <tr valign="middle"> <td> <?php echo $leftmenudisplay; ?> </td> <td align="right"> <?php echo $rightmenudisplay; ?> </td> </tr> </table> </ul> </div> <!-- end menu --> <!-- start page --> <div id="page"> <!-- start content --> <div id="content_b"> <div class="post"> <div class="title"> <h2>New Blog</h2> <div id="blogfooterlink"><table width="100%"><tr valign="top"><td align="left" valign="middle"><p><small>Write your title and content below.</small></p></td><td align="right" valign="top"><img src="images/content/return.png" alt="" /> <a href="mypicture.php">Return to My Account</a></td></tr></table></div> </div> <div class="entry"> <p> <form id="newblogform" method="post" onsubmit="return submitForm();"> <script language="JavaScript" type="text/javascript"> function submitForm() { //make sure hidden and iframe values are in sync before submitting form updateRTE('rte1'); //use this when syncing only 1 rich text editor ("rtel" is name of editor) //updateRTEs(); //uncomment and call this line instead if there are multiple rich text editors inside the form //alert("Submitted value: "+newblogform.rte1.value); //alert submitted value true; //Set to false to disable form submission, for easy debugging. } //Usage: initRTE(imagesPath, includesPath, cssFile) initRTE("images/richtext/", "", ""); </script> <table> <tr> <td><b>Title</b></td> </tr> <tr> <td><input id="title" name="blogtitle" type="text" size="40" maxlength="40" value="<?php echo $_SESSION['blogtitle'];?>"></td> </tr> <tr> <td> <script language="JavaScript" type="text/javascript"> //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly) //writeRichText('rte1', '', 760, 300, true, false); //var test=document.getElementById(rte1); writeRichText('rte1', '<? echo $_SESSION["rte1"]; ?>', 760, 300, true, false); //--> </script> </td> </tr> <tr> <td> <input type="submit" name="postsubmit" value=" Post" size="20"/><font style="color:red; font-weight:bold;"><?php echo $_SESSION['error'];?></font> </td> </tr> </table> </form> </p> </div> </div> </div> <!-- end content --> <div id="extra" style="clear: both;"> </div> </div> <!-- end page --> <!-- start footer --> <div id="footer"> <p class="legal"></p> </div> <!-- end footer --> </body> </html> <?php if (isset($_POST['postsubmit'])) { if(isset($_SESSION['username'])) { $_SESSION['blogtitle']=ltrim($_POST['blogtitle']); $_SESSION['blogcontent']=$_POST['rte1']; if($_SESSION['blogtitle']<>'') { if($_SESSION['blogcontent']<>'') { include("MySQLconnect.php"); //Insert new blog mysql_query("INSERT INTO `blog` (`memberid`,`blogdatetime`,`blogtitle`,`blogcontent`) VALUES('{$_SESSION['memberid']}',NOW(),'{$_SESSION['blogtitle']}','{$_SESSION['blogcontent']}');") or die(mysql_error()); $recentblog=mysql_query("SELECT * FROM `blog` WHERE memberid='".$_SESSION['memberid']."' ORDER BY blogid DESC LIMIT 0,1;"); $recentblogcolumn=mysql_fetch_assoc($recentblog); //Insert into commmunity's recent activities $action='<div id="blogfooterlink"><a href="/blogmember.php?username='.$_SESSION['username'].'">'.$_SESSION['username'].'</a> wrote a blog called <a href="/blogdetail.php?username='.$_SESSION['username'].'&blogid='.$recentblogcolumn['blogid'].'">'.$_SESSION['blogtitle'].'</a></div>'; mysql_query("INSERT INTO `community` (`avatar`,`action`,`createdate`) VALUES('{$_SESSION['avatar']}','{$action}',NOW());") or die(mysql_error()); header("Location: /myaccount.php"); } else { $_SESSION['error']=' You must write something in your blog.'; header("Location: /newblog.php"); } } else { $_SESSION['error']=' You must write a title for your blog.'; header("Location: /newblog.php"); } } else { header("Location: /memberonly.php"); } } else { $_SESSION['error']=''; $_SESSION['blogtitle']=''; $_SESSION['blogcontent']='<script language="JavaScript" type="text/javascript">document.getElementById(rte1).value;</script>'; } ?> I am trying to get $_SESSION['blogcontent'] to store a value from javascript. I want to let user to write a blog, click on other links on my website, then come back to the page and it'll still show what they wrote until it's submitted. Below is a login account to www.blogoberry.com username: test password: test 1) Login 2) Click on Write New Blog 3) Write something there 4) Click on other links 5) Click on your account (upper right hand ) 6) Click on Write New Blog 7) Still show the content of blog that was written previously I appreciate any help..
-
[SOLVED] Submitting values from radio button to mysql database
eatfishy replied to unknown1's topic in PHP Coding Help
do u have <form name="test" method="post" /> in your code somewhere? -
use firefox browser and view source code.
-
[SOLVED] Submitting values from radio button to mysql database
eatfishy replied to unknown1's topic in PHP Coding Help
Try the below statement. $sql = "INSERT INTO `table` (id_ListType) VALUES (' {$listing_type} ')"; -
Yes. When you upload an image, it doesn't go straight to the path you want. It goes to the temp path first and then the actual path you want. You need to specify the temp path. 1) Specify the temp path in your PHP script. 2) Set the server temp path to the same as your PHP script. (I'm sure the Go Daddy IT team can show u this) I can show u some example once I get home.
-
Sure there is...you can use the $POST[] method to check through all the checkboxs and count them up.
-
I was in the same situation as you a few days ago. I turned all the error report and didn't see any errors. I also check my script so many times and logically, it make sense to me. I found out that there's some PHP server configation that I had to do. 1) Ensure your .ini setting is set to upload file, the the size limitation, etc 2) Ensure that you set the path to the temporary upload on your server setting( I know my default temp path didn't work and I changed it to the temp path that I want). 3)If it still doesn't work, you can contact me on www.blogoberry.com since I check that website a few times a day.
-
I think using Session to store data on server side is the safest, but if you want to pass data without Session. I would recommend using $_GET['variable']
-
You can do this with IF statement and Replace String Function()
-
It sounds more like a PC help than coding. Why can't you right click on the link and do SAVE IMAGE AS ? This will download the file for you to the location you want.
-
while ($line = mysql_fetch_assoc($results)) Shouldn't you be using == instead of = ? == is for comparing = is for storing
-
If that's all the PHP code you have to run queries in MySQL, it will not work. I don't see any connection setup in there (the server name, database name?) Also, you could create 1 query (lil more complicated) or 3 separate queries (easier to read) to do the update. Below is an example of 3 separate queries: Update Subscribers Set status='1',uniquieid='id',enddate='CURDATE()' WHERE enddate<CURDATE() Update Subscribers Set status='1',uniquieid='id',enddate='CURDATE()' WHERE enddate IS NULL Update Subscribers Set status='1',uniquieid='id',enddate=endate, INTERVAL + 1 YEAR WHERE enddate>CURDATE() I don't have access to MYsql currently, but it should be something like that above. Also, the date calculation doesn't look right to me (enddate=endate, INTERVAL + 1 YEAR)?