Jump to content

JohnOP

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JohnOP's Achievements

Member

Member (2/5)

0

Reputation

  1. Im trying to rewrite my urls to look more pretty http://example.com/profile.php?id=username to look like http://example.com/username When testing i can get it too work as http://example.com/username.html RewriteEngine On RewriteRule ^([^/]*).html$ profile.php?id=$1 [L] but when i remove the .html from the rewrite rule, the page works with /username but it doesnt pick up the variable to show the respective profile like it does with the .html, im not sure what the problem is.
  2. I am trying to code a php, mysql and jquery pagination much like the way twitter's pagination works. Page 1 i have <div id="load_more"> <?php $query = mysql_query("SELECT * FROM comments ORDER BY id DESC LIMIT 5"); while($row = mysql_fetch_assoc($query)){ $id = $row['id']; // show comments code } ?> </div> <script type="text/javascript"> $(function() { $('.showmore').live("click",function() { var ID = $(this).attr("id"); if(ID) { $("#more"+ID).html('<img src="ajax-loader.gif" />'); $.ajax({ type: "POST", url: "comments_more.php", data: "lastmsg="+ ID, cache: false, success: function(html){ $("#load_more").append(html); $("#more"+ID).remove(); // removing old more button } }); } else { $(".morebox").html('No more comments.');// no results } return false; }); }); </script> <div id="more<?php echo $id; ?>" class="morebox"> <a href="javascript:;" style="text-decoration: none; font-size: 12px; color: #ffffff; font-weight: bold; " class="showmore" id="<?php echo $id; ?>">Load More Comments</a> </div> So i am only showing 5 rows untill the link is clicked and then i want it to load more comments from comments_more.php which is the same page as above just it checks for the lastmsg id and alters the query to WHERE id < '$lastmsg'. Everything works ok for clicking the link and showing more results but it only works once. even if there is more than 10 rows it will show as "no more comments" after 10. Any help will be appreciated thanks.
  3. I see what you mean though how could i write "If two rows with time span of under 2 minutes that have the same id, username" within the while loop which gets all different users, post at the same time.
  4. Same place you have it just add the new text beside the row data <?php echo "Location". $row['Location'] . "<br>\n"; // Where 'location' is the column/field title in the database echo "Property". $row['Property_type'] . "<br>\n"; // as above echo "Bedrooms". $row['Number_of_bedrooms'] . "<br>\n"; // .. echo "Purchase". $row['Purchase_type'] . "<br>\n"; // .. echo "Price". $row['Price_range'] . "<br>\n"; // .. ?>
  5. Whats wrong with just printing the names? echo "Location".$row['Location'] . "<br>\n";
  6. Yes preferably i could make a stream_id in the table and check it against there recent posts but i can't update the row in the stream to show more images as the stream table only holds one column for a photo. I looked up using multiple values in one column but i seen it was looked upon.
  7. I am creating a stream for my website similar to facebook's news feed where users can post to, add photos too ect. When a user uploads a photo it gets added to the photos table and a new row to the stream mysql_query("INSERT INTO photos VALUES ('','$id','$username','$photo','$time')"); mysql_query("INSERT INTO stream VALUES ('','$id','$username','$time','No comment','$photo','')"); Which displays the image on the stream fine but what i am looking to do is if the user uploads more images one after another instead of adding a new post to the stream for every picture i want to show all of the new pictures in one post like what Facebook does. I can't figure out how i would do this.
  8. I have a comment type of system that i am building which is using jquery to post the comments. When posting a new comment, the div that holds all the comments gets the new post added to it without page refresh which is all good and how i want it. I noticed though if i sign in to my website on another computer and am on the same page as the comments, only the one whom posted the comments div will update because its only them who are firing the form so any other user would have to refresh the page to see the new comment. <script type="text/javascript"> $('form[name=feedUpdate3]').submit(function(){ var id = <?php echo ($id) ?>; var share = $('.expand'+id).val(); var post_id = $('.post_id'+id).val(); $.post('updateFeeds.php', { share: share, post_id: post_id }, function(data){ $('#show_comments'+id).load('post_comments.php?post_id='+id); }); </script> #show_comments is the comments div I have a working solution which is to poll the comments div every so many seconds so all users would get updated with any new comments without having to refresh the page though i know that would cause heavy load on the server. I am just looking for another solution to this.
  9. Oh its a dot and not a comma, thanks a lot that worked.
  10. It doesn't one is the table name and one is the column from that table.
  11. I'm re doing my private message system and im watching a video tutorial on it but have got this very strange error with the max() function code <?php $sql = "SELECT `conversations`,`conversation_id`, `conversations`,`conversation_subject`, MAX(`conversations_messages`,`message_date`) AS `conversation_last_reply` FROM `conversations` LEFT JOIN `conversations_messages` ON `conversations`,`conversation_id` = `conversations_messages`,`conversation_id` INNER JOIN `conversations_members` ON `conversations`,`conversation_id` = `conversations_members`,`conversation_id` WHERE `conversations_members`,`user_id` = {$id} AND `conversations_members`,`conversation_deleted` = 0 GROUP BY `conversations`,`conversation_id` ORDER BY `conversation_last_reply` DESC"; All the fields and tables are correct and i get this error
  12. Hi im looking for some help on the paypal IPN, i am creating a subscrtiption page on my forums and am having trouble with paypal. Here is the relevant part of the ipn code if ($payment_status=="Completed"){ if ($payment_currency=="USD"){ if ($payment_amount == "$5.00"){ define("IN_MYBB", "1"); require("./global.php"); $db->update_query("users", array("usergroup" => "8"), "`uid` = '$custom'"); } } } Now when i run that in the sandbox it works fine and upgrades the account however when i try it with a real payment from the form it doesnt work which is realy weird. <form action='https://www.paypal.com/cgi-bin/webscr' method='POST'> <input type='hidden' name='cmd' value='_xclick'> <input type='hidden' name='business' value='EMAIL' /> <input type='hidden' name='item_name' value='MyBB Subscription for USERNAME, [uID]'> <input type='hidden' name='custom' value='USERS UID' /> <input type='hidden' name='image_url' value='' /> <input type='hidden' name='no_shipping' value='1' /> <input type='hidden' name='notify_url' value='SITE ADDRESS' /> <input type='hidden' name='return' value='SITE ADDRESS /> <input type='hidden' name='cancel_return' value='SITE ADDRESS' /> <input type='hidden' name='bn' value='PP-SubscriptionsBF' /> <input type='hidden' name='amount' value='5.00'> <input type='hidden' name='currency_code' value='USD' /> <input type='image' src='https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' alt='PayPal - The safer, easier way to pay online!'> <img alt='' border='0' src='https://www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'> </form> I don't see why it would work in the sandbox and not on the real form any help will be much appreciated.
  13. Hi i am needing some help using jquery tabs i have one page with tabs on them and when the user goes to each tab it shows diffrent content for each tab without refresh. On one tabs content i have a reload button for the user to reload that tabs content but with just a normal reload it will go back to tab 1 and its content instead of the tab its on. <ul id="home-ul" class="idTabs"> <li id="home-li"><a href="#tab1">Subscribers</a></li> <li id="home-li"><a href="#tab2">Friends</a></li> <li id="home-li"><a href="#tab3">Video Views</a></li> <li id="home-li"><a href="#tab4">Channel Views</a></li> <li id="home-li"><a href="#tab5">Website Views</a></li> </ul> I cant reload the page to #tab2 because the #tabx does not get put in to the url when clicking as it doesnt refresh the page when moving through tabs. Is there anyway i can get it to reload to a certain tab.
  14. The images i have are resized in css and are pulled from the database for each user but when vieweing the page the image slowly loads in like its lagging in.
×
×
  • 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.