PHP - Moved: Wall Script Tutorial Help
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=334229.0 Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=308352.0 This topic has been moved to Linux. http://www.phpfreaks.com/forums/index.php?topic=334310.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=351363.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=330907.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=130332.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343600.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=348851.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=332907.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316360.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=351535.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321530.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342211.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=347977.0 Hi folks, i have been playing with a script i downloaded from the net and have made some progress with it, however i have a couple of issues which i cannot figure out. There are two undefined variables which keep cropping up, and i cant figure out why or how to deal with it. <?php include('dbcon.php'); function checkValues($value) { $value = trim($value); if (get_magic_quotes_gpc()) { $value = stripslashes($value); } $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES))); $value = strip_tags($value); $value = mysql_real_escape_string($value); $value = htmlspecialchars ($value); return $value; } function clickable_link($text = '') { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); $ret = ' ' . $text; $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); $ret = substr($ret, 1); return $ret; } $next_records = 10; $show_more_button = 0; if(checkValues($_REQUEST['value'])) { $userip = $_SERVER['REMOTE_ADDR']; echo "INSERT INTO facebook_posts (post,f_name,userip,date_created) VALUES('".checkValues($_REQUEST['value'])."','99Points','".$userip."','".strtotime(date("Y-m-d H:i:s"))."')"; mysql_query("INSERT INTO facebook_posts (post,f_name,userip,date_created) VALUES('".checkValues($_REQUEST['value'])."','99Points','".$userip."','".strtotime(date("Y-m-d H:i:s"))."')"); $result = mysql_query("SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM facebook_posts order by p_id desc limit 1"); } } elseif($_REQUEST['show_more_post']) // more posting paging { i have highlighted the two variables which are showing as undefined. The javascript code (not complete script) which goes in hand with this script is: Code: [Select] <script type="text/javascript"> // <![CDATA[ $(document).ready(function(){ $('#shareButton').click(function(){ var a = $("#watermark").val(); if(a != "What's on your mind?") { $.post("posts.php?value="+a, { }, function(response){ $('#posting').prepend($(response).fadeIn('slow')); $("#watermark").val("What's on your mind?"); }); } }); $('a.more_records').livequery("click", function(e){ var next = $(this).attr('id').replace('more_',''); $.post("posts.php?show_more_post="+next, { }, function(response){ $('#bottomMoreButton').remove(); $('#posting').append($(response).fadeIn('slow')); }); }); Does anyone have any idea on how or what i can do to stop these error messages appearing? Any help would be appreciated... Hi, I am trying to extract a address from a txt file (Emergency Pager Messages) and I've got to the point where I strip everything not needed in the string but I am left with this: BURNOFF THREATENING 33 SOMEPLACE RD MONTROSE My question is this, how do I strip everything BEFORE (which could be numerous different words) the number leaving just: 33 SOMEPLACE RD MONTROSE And second question how can I strip everything after the number (including the number itself) leaving just: BURNOFF THREATENING There can be a thousand different words before the number describing the job and yer as I said I need to strip them to leave the address but also need to strip the address leaving the description only... I hope that makes sense and I'd REALLY appreciate any pointers in the right direction... Hello guys, Is there on web any updated tutorial on how can I add Facebook login on my simple php login script? Hey all, Quick sum up: I have a social website where users can follow/post/vote etc. I am adding a new facebook-like activity wall feature to each users profiles. I have worked on this bit for a few days now and can't seem to get it to work properly. What I want is, well, exactly like the facebook wall as I mentioned...When a visitor visits a user's profile, that user's activity will display, whether they recently "voted" on a post, commented, or posted something of their own, I would like it to display on their profile and of course, have the most recent entries on top. The problems I am having right now a it's displaying some things twice and it's not sorting them by the most recent. I am working with 3 tables here (I only posted the columns that I am using): Code: [Select] Table structure for table votes_posts Field Type Null Default indexer int(11) No post_id int(11) No vote int(11) No user_name varchar(250) No date varchar(255) No Table structure for table posts Field Type Null Default id int(11) No name varchar(30) No content text No datetimerss varchar(255) No category int(11) No Table structure for table comments Field Type Null Default id int(12) No post_id int(12) No name varchar(30) No content text No type varchar(30) No datetimerss varchar(255) No $users is just $_GET['user'] The timeAgo() function, simply displays the very popular "posted xx ago" date time. <ul class="streamActivity"> <?php $checkActivity = "SELECT votes_posts.post_id, votes_posts.user_name, votes_posts.vote, votes_posts.date, posts.id, posts.content, posts.name, posts.datetimerss, categories.category, comments.post_id AS comm_postid, comments.content AS comm_content, comments.name AS comm_name, comments.datetimerss AS comm_date, comments.type FROM `votes_posts` LEFT OUTER JOIN `posts` ON votes_posts.post_id = posts.id LEFT OUTER JOIN `comments` ON posts.id = comments.post_id LEFT OUTER JOIN `categories` ON posts.category = categories.cat_id WHERE (votes_posts.post_id = posts.id AND user_name = '$user') OR (comments.post_id = posts.id AND comments.name = '$user') OR (posts.name = '$user') ORDER BY votes_posts.date, posts.datetimerss, comments.datetimerss ASC"; $checkActivityResult = mysql_query($checkActivity); if (mysql_num_rows($checkActivityResult) > 0) { while ($sessionAct = mysql_fetch_array($checkActivityResult)) { $category = strtolower($sessionAct['category']); $dateVote = timeAgo($sessionAct['date']); $datePost = timeAgo($sessionAct['datetimerss']); $dateComm = timeAgo($sessionAct['comm_date']); $namePost = $sessionAct['name']; $nameComm = $sessionAct['comm_name']; $nameVote = $sessionAct['user_name']; $idVote = $sessionAct['post_id']; $idPost = $sessionAct['id']; $idComm = $sessionAct['comm_postid']; $contentPost = $sessionAct['content']; $contentComm = $sessionAct['comm_content']; $typeComm = $sessionAct['type']; if ($namePost == $user) { $classList = 'storyPost'; $classIcon = 'iconMuttr'; $name = $namePost; $content = $contentPost .' ... read more'; $datetime = $datePost; } elseif ($nameComm == $user && $typeComm == "Comment") { $classList = 'actionPost'; $classIcon = 'iconComment'; $name = $nameComm; $content = 'Commented "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameComm == $user && $typeComm == "Advice") { $classList = 'actionPost'; $classIcon = 'iconAdvice'; $name = $nameComm; $content = 'gave Advice "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameVote == $user) { if ($sessionAct['vote'] == "1") { $classList = 'actionPost'; $classIcon = 'iconLaughed'; $name = $nameVote; $content = 'Laughed at "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "2") { $classList = 'actionPost'; $classIcon = 'iconLoved'; $name = $nameVote; $content = 'Showed Love on "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "3") { $classList = 'actionPost'; $classIcon = 'iconIdiot'; $name = $nameVote; $content = 'called '. $namePost .' an Idiot for "'. $contentPost .'"'; $datetime = $dateVote; } } ?> <li class="row-activity <?php echo $classList; ?>"> <a href="" class="avatar"><img src="/images/avatars/default_male.jpg" /></a> <div class="info"> <div class="userName"> <a href=""><?php echo $name; ?></a> </div> <span class="msgBody"><?php echo $content; ?></span> <div class="imgTimeStream"> <span class="img <?php echo $classIcon; ?>"></span> <span class="source"><?php echo $datetime; ?></span> </div> </div> </li> <?php } } else { echo '<p>This user has no recent activity.</p>'; } ?> </ul> I am by no means an expert programmer...everything I know I have pretty much taught myself over the past year or two, so I can only imagine how ugly this truly is lol. I am learning each and everyday though, and I hope to continue Also, within each type of activity, there will be slightly different CSS classes on some things. Example: if the result row is a post then the css class of the list item would be "post" if the result row is a vote then the css class of the list item would be "vote" etc. Any help would be appreciated! This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=348869.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=322839.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=307535.0 |