Jump to content

ukscotth

Members
  • Posts

    195
  • Joined

  • Last visited

Everything posted by ukscotth

  1. Thanks so much for your help. Ive just upgraded to the latest version of joovili and theyve changed the code for the messages :( :( any chance you could help me on this file, ive tried myself by copying what you did but for some reason it wont work ??? ??? ## SEND NEW MESSAGE function send_message() { global $lang, $message_count, $max_messages, $session_logged; if ($session_logged == 'true') { if ($message_count <= $max_messages) { $to = $_POST['to']; $to_users = explode(";", $to); for($i=0;$i<count($to_users);$i++){ $userexists = sql_query("SELECT * FROM joovili_users WHERE username = '".$to_users[$i]."' LIMIT 1"); $blockexists = sql_query("SELECT * FROM joovili_blocked WHERE block_username = '".$to_users[$i]."' AND block_who = '".$_COOKIE['session_username']."'"); if (mysql_num_rows($userexists) == 0 ) { return message_status('error', $lang['messages_error_uexists']); } else if (mysql_num_rows($blockexists) != 0 ) { return message_status('error', $lang['messages_error_ublock']); } else if ($_POST['to'] == $_COOKIE['session_username']) { return message_status('error', $lang['messages_error_uself']); } else if (empty($_POST['subject'])) { return message_status('error', $lang['messages_error_esubject']); } else if (empty($_POST['message'])) { return message_status('error', $lang['messages_error_emessage']); } else { sql_query("INSERT INTO joovili_messages (message_to, message_from, message_subject, message_body, message_date) VALUES ('".$to_users[$i]."', '".$_COOKIE['session_username']."', '".$_POST['subject']."', '".$_POST['message']."', '".date_time('datetime')."')"); $user = mysql_fetch_array($userexists); if ($user['notify_messages'] == '1') { include("language/".SITELANG."/joovili_emails.php"); mail($user['email'], $message_subject, $message_email.$footers, $headers); } } return message_status('done', $lang['messages_sending']); } } } } Original code before i messed with it ## SEND NEW MESSAGE function send_message() { global $lang, $message_count, $max_messages, $session_logged; if ($session_logged == 'true') { if ($message_count <= $max_messages) { $userexists = sql_query("SELECT * FROM joovili_users WHERE username = '".$_POST['to']."' LIMIT 1"); $blockexists = sql_query("SELECT * FROM joovili_blocked WHERE block_username = '".$_POST['to']."' AND block_who = '".$_COOKIE['session_username']."'"); if (mysql_num_rows($userexists) == 0 ) { return message_status('error', $lang['messages_error_uexists']); } else if (mysql_num_rows($blockexists) != 0 ) { return message_status('error', $lang['messages_error_ublock']); } else if ($_POST['to'] == $_COOKIE['session_username']) { return message_status('error', $lang['messages_error_uself']); } else if (empty($_POST['subject'])) { return message_status('error', $lang['messages_error_esubject']); } else if (empty($_POST['message'])) { return message_status('error', $lang['messages_error_emessage']); } else { sql_query("INSERT INTO joovili_messages (message_to, message_from, message_subject, message_body, message_date) VALUES ('".$_POST['to']."', '".$_COOKIE['session_username']."', '".$_POST['subject']."', '".$_POST['message']."', '".date_time('datetime')."')"); $user = mysql_fetch_array($userexists); if ($user['notify_messages'] == '1') { include("language/".SITELANG."/joovili_emails.php"); mail($user['email'], $message_subject, $message_email.$footers, $headers); } return message_status('done', $lang['messages_sending']); } } } }
  2. WOW that TinyMCE looks amazing, is it easy to setup for a newbie ? i have done a bit of php and sql im not completly new lol
  3. oh right ok thnx, il have a look at those 2 things
  4. Hi, Im running a basic forum on a social networking site and was wandering if instead of the users having to put [ URL ][ /URL ] around there url's to make them links there was away to just automatically make links when people type http://xxx.xxxxxx.xxx Just like it did then. I guess it would be something to do with the REPLACE command but Im not too good at all this, can anyone help plzz ?
  5. sorted. Thanks alot for ur help, ur a star most appreciated.
  6. tried that but not sure where to put the actual variable where the date is stored. Would it be something like this ? <?php echo date ($topic['topic_last_post']); ?>
  7. Hi, I think this should be pretty easy for someone who knows how. I have a date and time stored in a database field and when i do a simple echo it shows up like this : 1224950428 Is there an easy way i can make it display something like this instead : 23 March, 8:45pm Many thanks in advance. Scott.
  8. seems to be working fine, im probably only gonna let mods use it but if i run into any probs il let u know, thanks again
  9. ok ive uploaded the new file and when i try and enter more than one user in the 'message_to' input box i get this error User does not exist
  10. ok thanks. <?php /*************************************************************************** * * Copyright © 2007 Joovili * ------------------------------------- * Version: 2.1 * ------------------------------------- * www.joovili.com * **************************************************************************** * Page: my_messages_new.php ***************************************************************************/ include("include/settings.inc.php"); /*************************************************************************** * USER LOGGED IN ---> ***************************************************************************/ session_exists ($session_logged); /*************************************************************************** * CHECK PRIVILEGES ---> ***************************************************************************/ $messages_date = gmdate("jS M Y"); $check_sent_messages = sql_number("SELECT * FROM joovili_messages WHERE message_from='".$user_info['username']."' AND message_date LIKE '%".$messages_date."%'"); if (($user_info['account_type']==1 || $user_info['account_type']==3)&&($site_settings['joovili_upgrades']=='Yes')){ $total_messages = $site_privileges['u_messages']; } else { $total_messages = $site_privileges['f_messages']; } /*************************************************************************** * SEND MESSAGE ---> ***************************************************************************/ if (isset($_POST['message_send'])){ ## STOP THE SMART PEOPLE FROM SENDING MORE MESSAGES THAN THEY ARE ALLOWED $check_sent_again = sql_number("SELECT * FROM joovili_messages WHERE message_from='".$user_info['username']."' AND message_date LIKE '%".$messages_date."%'"); if (1==1) { ## CHECK USER EXISTS AND IF BLOCKED $check_user_exists = mysql_query("SELECT * FROM joovili_users WHERE username='".$_POST['message_to']."'"); $check_blocked = mysql_query("SELECT * FROM joovili_block WHERE blocked='".$user_info['username']."' AND blocker='".$_POST['message_to']."'"); if (empty($_POST['message_to'])){ header ('Location: my_messages_new.php?action=error_empty&username='.$_POST['message_to'].'&subject='.$_POST['message_subject'].'&message='.$_POST['message_body']); } else if (mysql_num_rows($check_blocked)!=0){ header ('Location: my_messages_new.php?action=error_blocked&username='.$_POST['message_to'].'&subject='.$_POST['message_subject'].'&message='.$_POST['message_body']); } else if (mysql_num_rows($check_user_exists)==0){ header ('Location: my_messages_new.php?action=error_user&username='.$_POST['message_to'].'&subject='.$_POST['message_subject'].'&message='.$_POST['message_body']); } else if (empty($_POST['message_subject'])){ header ('Location: my_messages_new.php?action=error_empty&username='.$_POST['message_to'].'&subject='.$_POST['message_subject'].'&message='.$_POST['message_body']); } else if (empty($_POST['message_body'])){ header ('Location: my_messages_new.php?action=error_empty&username='.$_POST['message_to'].'&subject='.$_POST['message_subject'].'&message='.$_POST['message_body']); } else { mysql_query("INSERT INTO joovili_messages (message_to,message_from,message_subject,message_body,message_date) VALUES ('".$_POST['message_to']."', '".$user_info['username']."', '".$_POST['message_subject']."', '".$_POST['message_body']."', '".date_time(normal)."')"); mysql_query("INSERT INTO message_history (message_to,message_from,message_subject,message_body,message_date) VALUES ('".$_POST['message_to']."', '".$user_info['username']."', '".$_POST['message_subject']."', '".$_POST['message_body']."', '".date_time(normal)."')"); mysql_query("INSERT INTO joovili_messages_outbox (message_to,message_from,message_subject,message_body,message_date) VALUES ('".$_POST['message_to']."', '".$user_info['username']."', '".$_POST['message_subject']."', '".$_POST['message_body']."', '".date_time(normal)."')"); #### START OF VIRTUAL GIFT CODE $rates = sql_row("SELECT * FROM joovili_earning_rates WHERE rate_set='standard'"); mysql_query("UPDATE joovili_users SET user_points=user_points+'".$rates['message_rate']."' WHERE username='".$user_info['username']."'"); ### END OF VIRTUAL GIFT CODE while($checked_user_exists = mysql_fetch_array($check_user_exists)){ if ($checked_user_exists['notify_messages']==1){ include("include/emails.inc.php"); mail($checked_user_exists['email'], $email_message_subject, $email_message, $headers); } } header ('Location: my_messages.php?action=message_sent'); } } } /*************************************************************************** * MESSAGES SUB MENU ***************************************************************************/ $sub_menu = '<a href="my_messages.php" class="sub_page_titles"> ' . $lang['messages_inbox'] . '</a> (' . user_info($user_info['username'], new_messages) . ') | <a href="my_outbox.php" class="sub_page_titles"> ' . $lang['messages_outbox'] . '</a> | <a href="my_notifications.php" class="sub_page_titles"> ' . $lang['messages_notifications'] . '</a> (' . user_info($user_info['username'], new_notifications) . ') | <a href="my_messages_new.php" class="sub_page_titles"> ' . $lang['messages_new']. '</a>'; /*************************************************************************** * INCLUDE HEADER ***************************************************************************/ include("themes/".$site_theme."/joovili_header.php"); ?> <table width="100%" border="0"> <tr> <td width="50%"><table width="100%" border="0"> <tr> <td class="page_titles"><?php echo $lang['messages_new_message'];?></td> </tr> <tr> <td height="20"> <img src="themes/<?php echo $site_theme;?>/images/014.gif" width="100%" height="1" /></td> </tr> <tr> <td align="right" class="sub_page_titles"><?php echo $sub_menu; ?></td> </tr> </table> <br /> <?php /********************************************* * ERROR! EMPTY FIELDS --> *********************************************/ if ($_GET['action'] == 'error_empty') { ?> <table width="100%" border="0" cellpadding="4" cellspacing="0" class="error_table"> <tr> <td width="10%" align="center"><img src="themes/<?php echo $site_theme;?>/images/icons/017.gif" /></td> <td width="90%"><?php echo $lang['messages_send_error_empty'];?></td> </tr> </table> <br /> <?php } ?> <?php /********************************************* * ERROR! BLOCKED --> *********************************************/ if ($_GET['action'] == 'error_blocked') { ?> <table width="100%" border="0" cellpadding="4" cellspacing="0" class="error_table"> <tr> <td width="10%" align="center"><img src="themes/<?php echo $site_theme;?>/images/icons/017.gif" /></td> <td width="90%"><?php echo "Sorry but this user has blocked you from contacting them";?></td> </tr> </table> <br /> <?php } ?> <?php /********************************************* * ERROR! SEND TO DOES NOT EXIST --> *********************************************/ if ($_GET['action'] == 'error_user') { ?> <table width="100%" border="0" cellpadding="4" cellspacing="0" class="error_table"> <tr> <td width="10%" align="center"><img src="themes/<?php echo $site_theme;?>/images/icons/017.gif" /></td> <td width="90%"><?php echo $lang['messages_send_error_exist'];?></td> </tr> </table> <br /> <?php } ?> <?php if (1==3){ ?> <table width="100%" border="0" cellpadding="4" cellspacing="0" class="error_table"> <tr> <td width="10%" align="center"><img src="themes/<?php echo $site_theme;?>/images/icons/017.gif" /></td> <td width="90%"><?php echo $lang['messages_send_limit'];?></td> </tr> </table> <br /> <?php } else { echo "<form method=\"post\" action=\"my_messages_new.php\">"; } ?> <table width="100%" border="0" cellpadding="4" cellspacing="1" class="table"> <tr> <td colspan="3" class="titles"><?php echo $lang['messages_new_message'];?></td> </tr> <tr> <td width="20%" class="text">To</td> <td width="75%" colspan="2"><input name="message_to" type="text" class="form_text_field" value="<?php if (isset($_GET['username'])){ echo $_GET['username']; } else { echo $_POST['message_to']; } ?>" maxlength="40" /></td> </tr> <tr> <td class="text">Subject</td> <td colspan="2"><input name="message_subject" type="text" class="form_text_field" value="<?php if ($_GET['subject']){ echo $_GET['subject']; } else { echo $_POST['message_subject']; }?>" maxlength="40" /></td> </tr> <tr> <td valign="top" class="text">Message</td> <td width="40%"><textarea name="message_body" id="message_body" rows="7" class="form_text_area" style="width: 100%;"><?php if ($_GET['message']){ echo $_GET['message']; } else { echo $_POST['message_body']; } ?></textarea></td> <td width="40%"><table border="0" align="center" cellpadding="2" cellspacing="1" class="smilies_table"> <tr> <td width="5%"><img src="themes/<?php echo $site_theme;?>/images/smilies/001.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td width="20%"></td> <td width="5%"><img src="themes/<?php echo $site_theme;?>/images/smilies/006.gif" width="20" onclick="document.getElementById('message_body').value+=':|'" style="cursor: pointer; cursor: hand;" /></td> <td width="20%">:|</td> <td width="5%"><img src="themes/<?php echo $site_theme;?>/images/smilies/011.gif" width="20" onclick="document.getElementById('message_body').value+=':roll:'" style="cursor: pointer; cursor: hand;" /></td> <td width="20%">:roll:</td> <td width="5%"><img src="themes/<?php echo $site_theme;?>/images/smilies/005.gif" width="20" onclick="document.getElementById('message_body').value+=':cool:'" style="cursor: pointer; cursor: hand;" /></td> <td width="20%">:cool:</td> </tr> <tr> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/002.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td></td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/007.gif" width="20" onclick="document.getElementById('message_body').value+=':S'" style="cursor: pointer; cursor: hand;" /></td> <td>:S</td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/012.gif" width="20" onclick="document.getElementById('message_body').value+=':oO:'" style="cursor: pointer; cursor: hand;" /></td> <td>:oO:</td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/010.gif" width="20" onclick="document.getElementById('message_body').value+=':oo:'" style="cursor: pointer; cursor: hand;" /></td> <td>:oo:</td> </tr> <tr> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/003.gif" width="20" onclick="document.getElementById('message_body').value+=':A'" style="cursor: pointer; cursor: hand;" /></td> <td>:A</td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/008.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td></td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/013.gif" width="20" onclick="document.getElementById('message_body').value+=':Y'" style="cursor: pointer; cursor: hand;" /></td> <td>:Y</td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/015.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td></td> </tr> <tr> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/004.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td></td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/009.gif" width="20" onclick="document.getElementById('message_body').value+=''" style="cursor: pointer; cursor: hand;" /></td> <td></td> <td><img src="themes/<?php echo $site_theme;?>/images/smilies/014.gif" width="20" onclick="document.getElementById('message_body').value+=':W'" style="cursor: pointer; cursor: hand;" /></td> <td>:W</td> <td> </td> <td> </td> </tr> </table></td> </tr> <tr> <td> </td> <td colspan="2"><input name="message_send" type="submit" class="form_button" value="<?php echo $lang['messages_button'];?>" /></td> </tr> </table> </form> </td> </tr> </table> <div align="center"><a href="http://www.sound-light-company.co.uk" target="_blank"><img src="Adverts/slc.gif" width="510" height="100" border="0" /></a></div> <?php include("themes/".$site_theme."/joovili_footer.php");?>
  11. sorry for being stoopid but i dont know what u mean, wudnt it be better to tell them once its working ?
  12. hi gevans, I havnt nope, at the moment its just set up so they can only send one message to one person at a time
  13. Hi, I run a social networking site which uses the joovili script and i would like members to be able to send a message to more than one person at once, I guess the best way would be to seperate the usernames with a coma e.g in the 'send to' field the user would put something like fred,mary,bill,sue Can someone plz help me code this as im new to php and cant work it out, at the moment this is the code that puts the message in the messages table : mysql_query("INSERT INTO joovili_messages (message_to,message_from,message_subject,message_body,message_date) VALUES ('".$_POST['message_to']."', '".$user_info['username']."', '".$_POST['message_subject']."', '".$_POST['message_body']."', '".date_time(normal)."')"); Hope someone can help as I have to send a message out to 50 users and dont want to have to do it one by one Thanks, Scott
  14. ahh ok, so do i simply do this : $get_feeds = mysql_query(" SELECT joovili_feeds.* FROM joovili_feeds LEFT JOIN joovili_buddies ON joovili_feeds.action_from = joovili_buddies.buddy_username OR joovili_feeds.action_to = joovili_buddies.buddy_username WHERE joovili_buddies.buddy_buddy = '".$user_info['username']."' UNION SELECT joovili_feeds.* FROM joovili_feeds LEFT JOIN joovili_buddies ON joovili_feeds.action_from = joovili_buddies.buddy_buddy OR joovili_feeds.action_to = joovili_buddies.buddy_buddy WHERE joovili_buddies.buddy_username = '".$user_info['username']."' ORDER BY id DESC LIMIT 50"); Thanks. Scott.
  15. Ok ive nearly managed to do it using this : $get_feeds = mysql_query("SELECT joovili_feeds.* FROM joovili_feeds LEFT JOIN joovili_buddies ON joovili_feeds.action_from = joovili_buddies.buddy_username OR joovili_feeds.action_to = joovili_buddies.buddy_username WHERE joovili_buddies.buddy_buddy = '".$user_info['username']."' ORDER BY id DESC LIMIT 50"); The only problem is that it only brings back results if your name is stored in buddy_buddy and the friends name is stored in buddy_username. I need it to work the other way round aswell so it will still give a result if your friends name is stored in buddy_buddy and your name is stored in buddy_username. Hope that makes sense, can anyone help ? Thanks in advance. Scott
  16. Hi Fenway, Basically buddy_username and buddy_buddy are the names of the 2 friends so if mark was toms friend, mark would be in the buddy_username field and tom would be in the buddy_buddy field or vice versa.
  17. Hi, Im trying to query 2 tables at the same time but Im having no luck, Ive tried learning all about the JOIN command but still I cant seem to get to grips with it, if anyone could help it would be most appreciated. Here is the structure of the 2 tables : Joovili_feeds ( id, action_from, action, action_to, action_date) Joovili_buddies (buddy_id, buddy_username, buddy_buddy, status) Basically Its for a social networking site and Im trying to create a modification that will show a recent buddies activity feed to the current user, the same kind of thing thats on facebook, so it shows the last ten joovili_feeds but only ones that are relative to your buddies. If the action is from somebody that is not in your buddy list then it must not be shown. I hope that makes sense. Many thanks. Scott
×
×
  • 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.