PHP - Moved: Phpbb3 Quote Notification
This topic has been moved to PHP Freelancing.
http://www.phpfreaks.com/forums/index.php?topic=320289.0 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=305801.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319172.0 Hey, I have written an external login script for my PHPBB3 forums but I am having trouble writing the script to allow the user to register and have their information added into the table phpbb_users which stores the phpbb account details. I have tried some code and written my own but I cannot seem to get it to input the data into the tables. Has anyone written a script for this or know of a place that I can learn how to do it??? Regards, Mathew Hood I've tried the PHPBB help forum and no one has answered. I thought i'd try here. For some reason i'm getting this weird error when I attempt to post. SQL ERROR [ mysqli ] Unknown column 'Tony' in 'where clause' [1054] SQL UPDATE phpbb_users SET user_gold = 50 WHERE username =Tony Tony is in the username row. What am I doing wrong? here's the code I'm using. Code: [Select] if (($mode == 'reply' || $mode == 'quote' || $mode == 'post')) { $sql = "UPDATE phpbb_users SET user_gold = 50 WHERE username =" . $user->data['username'] . ""; $db->sql_query($sql); } So I've got a simple news script that pulls the last 5 posts in a specific phpbb3 forum but I'm getting errors on the front page whenever they don't at least open the forums before. There errors: To narrow it down a little more for everyone, When they visit the home page( http://im.deathwillow.com ) before visiting the forums they receive the following errors. Once they have at least visited, not requiring a log in, the forums ( http://im.deathwillow.com/forums ) the errors disappear. Any ideas? Code: [Select] [phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /hermes/web03/b36/pow.deathwillow21/IM/index.php:8) [phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /hermes/web03/b36/pow.deathwillow21/IM/index.php:8) [phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /hermes/web03/b36/pow.deathwillow21/IM/index.php:8) The script: Code: [Select] <?php define('FORUM_ID', 6); // Forum ID to get data from define('POST_LIMIT', 5); // How many to get define('PHPBB_ROOT_PATH', './forums/'); // Path to phpBB (including trailing /) define('PRINT_TO_SCREEN', true); // If set to true, it will print the posts out // If set to false it will create an array $news[] with all the following info // // 'topic_id' eg. 119 // // 'topic_time' eg. 06 June, 07 (uses board default) // 'topic_replies' eg. 26 // // 'username' eg. chAos // 'topic_title' eg. "News Post" // // 'post_text' eg. just the text (formatted w/ smilies, bbcode, etc) define('IN_PHPBB', true); $phpbb_root_path = PHPBB_ROOT_PATH; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // Start session management $user->session_begin(false); $auth->acl($user->data); // Grab user preferences $user->setup(); $query = "SELECT u.user_id, u.username, t.topic_title, t.topic_poster, t.forum_id, t.topic_id, t.topic_time, t.topic_replies, t.topic_first_post_id, p.poster_id, p.topic_id, p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid FROM ".USERS_TABLE." u, ".TOPICS_TABLE." t, ".POSTS_TABLE." p WHERE u.user_id = t.topic_poster AND u.user_id = p.poster_id AND t.topic_id = p.topic_id AND p.post_id = t.topic_first_post_id AND t.forum_id = ".FORUM_ID." ORDER BY t.topic_time DESC"; $result = $db->sql_query_limit($query, POST_LIMIT); $posts = array(); $news = array(); $bbcode_bitfield = ''; $message = ''; $poster_id = 0; while ($r = $db->sql_fetchrow($result)) { $posts[] = array( 'topic_id' => $r['topic_id'], 'topic_time' => $r['topic_time'], 'username' => $r['username'], 'topic_title' => $r['topic_title'], 'post_text' => $r['post_text'], 'bbcode_uid' => $r['bbcode_uid'], 'bbcode_bitfield' => $r['bbcode_bitfield'], 'topic_replies' => $r['topic_replies'], ); $bbcode_bitfield = $bbcode_bitfield | base64_decode($r['bbcode_bitfield']); } // Instantiate BBCode if ($bbcode_bitfield !== '') { $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } // Output the posts foreach($posts as $m) { $poster_id = $m['user_id']; $message = $m['post_text']; if($m['bbcode_bitfield']) { $bbcode->bbcode_second_pass($message, $m['bbcode_uid'], $m['bbcode_bitfield']); } $message = str_replace("\n", '<br />', $message); $message = smiley_text($message); $comment = ($m['topic_replies']==1) ? 'comment' : 'comments'; if( PRINT_TO_SCREEN ) { /* Output is in the following format * * <h3>Thread Title</h3> ^ <h4 class="postinfo">date // 5 comments // poster</h4> * <p>First post test</p> * */ echo "<div class=\"newsPost\"> <h1><span class=\"topic\"><a href=\"".PHPBB_ROOT_PATH."viewtopic.php?f=".FORUM_ID."&t={$m['topic_id']}\">{$m['topic_title']}</a></span></h1> <p>{$message}</p> <div class=\"newsPost_footer\"> <span class=\"newsPost_comments\">Comments: <a href=\"".PHPBB_ROOT_PATH."viewtopic.php?f=".FORUM_ID."&t={$m['topic_id']}\">{$m['topic_replies']}</a></span><span class=\"newsPost_author\">Posted by <i><font color=\"#CCCCCC\">{$m['username']} </font>on " . $user->format_date($m['topic_time']) . "</i></span> </div> </div>"; } else { $news[] = array( 'topic_id' => $m['topic_id'], // eg: 119 'topic_time' => $user->format_date($m['topic_time']), // eg: 06 June, 07 (uses board default) 'topic_replies' => $m['topic_replies'], // eg: 26 'username' => $m['username'], // eg: chAos 'topic_title' => $m['topic_title'], // eg: "News Post" 'post_text' => $message, // just the text ); } unset($message,$poster_id); } ?> Helo, I am new here. I have a simple " Like " plugin for Vanilla Forums which does it work nicely. Sadly, it won't sent notifications when someone likes our post. I have another plugin from the same author which gives notifications on Profile-Like aka Kick/Poke. I am trying to use the notification part of the Kick plugin ( which I modified at my best to " Like ") added to the " Like " plugin so that I will able to provide notifications to post-authors on receiving a " Like ". I have created a GitHub repo with my attempt so far. It would be nice if someone can help me find a final solution. Thanks https://github.com/meetdilip/Like hi all,
how can i create a notification badge in php eg like when i have a new message, it will display on the nav indicating new message and the number of messages. thanks Hey guys what should i look for in a script to make a small script that gets the DB information and shows notifications? like messages(3) members(23) ..... i know count rows can do it.i think? hey guys im interested in the jquery notification scripts...where a user registers and then gets redirected to homepage where a notification pops up saying "thank you for registering".
now ive looked at a few examples online but im clueless to how each individiual notification pops up is it activated by the refering url?
would be good to know...but thats the only way to me that makes sense on how it works.
thank you
I apologize ahead if this is really an Apache question, but I suppose it could be in either forum. I have a web directory that when anything is accessed within it or its children from a range of IP addresses, they are redirected to a new URL, like so: .htaccess Options +FollowSymlinks RewriteEngine On RewriteCond %{REMOTE_ADDR} ^111\.111\.111\. [OR] RewriteCond %{REMOTE_ADDR} ^222\.222\.222\. RewriteRule !^(.*redirects.*)$ http://www.somedomain.com/something.php [L,NC,R] something.php <?php $to = "Someone <some@email.com>"; $subject = "Some Subject"; $headers = 'From: Somebody <no_reply@someone.com>' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $VisitorIp=$_SERVER['HTTP_X_FORWARDED_FOR']; else $VisitorIp=$_SERVER['REMOTE_ADDR']; trim($VisitorIp); $body = "Someone of IP " . $VisitorIp . " accessed resource\n"; mail($to, $subject, $body, $headers); ?> The problem is that I do not know on how to get the specific resource (URL) the client tried to access into the email, which I'd also like (e.g. more referrer information). The IP address is no problem though. Any ideas? Hello, I want this to Block NULLS and When its not there own. Please help. <?php if($_GET['usercp'] == 'vinbox' && $_GET['id']) { ?> <?php $id="{$_GET['id']}"; if($_GET['id'] == null or $_GET['id'] == 0){ die("You have reached a Null Page. <a href=\"index.php\">Go back home</a>"); } $view_a = mysql_query("SELECT * FROM notifications WHERE id='$id'"); while($view_b = mysql_fetch_array($view_a)){ $msgid = $view_b['id']; $msgname = $view_b['title']; $msgdate = $view_b['sent']; $msgsender = $view_b['senderid']; $msgreciever = $view_b['msgreciever']; $msgtext = $view_b['text']; $msgread = $view_b['read']; } $msgdatee = date('D, M d, Y h:i A', strtotime($msgdate)); $recieverfind = mysql_query("SELECT * FROM users WHERE id='$msgsender'"); While($recieverfound = mysql_fetch_assoc($recieverfind)) { $username = $recieverfound['username']; $userid = $recieverfound['id']; } if($userid == $msgreciever) { if($msgread <= 0){ mysql_query("UPDATE notifications SET `read`='1' WHERE `id`='".$id."'"); } ?> <div class="usercp_body"><!-- UserCP Notification Sent Start --> <div id="dash_chart" class="notifications" style="width:100%;margin: 0 auto;"> <div class="notifications-header"> <h4><center>Viewing Message: <?php echo ucfirst($msgname); ?></center></h4> </div> <div class="notifications-content" style="padding:10px 10px 10px 10px;"> <i><b>Sent From: </b></i><?php echo $username; ?><br> <i><b>Date Sent: </b></i><?php echo $msgdatee ;?><br> <i><b>Message: </b></i><br><hr><?php echo ucfirst($msgtext); ?> <br><hr><br> <i><b>Reply: </b></i><textarea> </textarea> </div></div></div><!-- UserCP Notification Sent End --> <?php } else { echo "This Message does not Belong to you"; } } Sorry for short explanation. I'm very tired Dear friends. Now I am doing Mobile APP by Flutter and Backend I use PHP, for normally using like get information and save information it's work by API concept. so now I would like to push notification to the mobile APP. is it can work by PHP or I need to use feature of firebase? I would like to have my site automatically email me about progress of users at certain times of the day. I am using PHP, but I think this is a server issue. I just need someone to point me in the right direction so I can search out the solution. Thank you. i have the following which sends an email whenever a post is made within the topic the user is subscribed to. However it still sends the email to the person who made the reply. I need to take out the email of the poster if they are in the notification list. This is what i have but it doesnt seem to remove them. $notification_query = $db->query("SELECT u.user_id, u.user_email, u.user_username, n.notification_user_id FROM ".DB_PREFIX."members as u LEFT JOIN ".DB_PREFIX."notifications as n ON n.notification_user_id = u.user_id WHERE n.notification_topic_id = '$post_id'") or trigger_error("SQL", E_USER_ERROR); $num_rows = mysql_num_rows($notification_query); while ($notification_list = mysql_fetch_object($notification_query)) { $users4[] = $notification_list->user_email; } $emailAddress = implode(', ', $users4); if (in_array($_SESSION['user_username'], $emailAddress)) { $emailAddress = str_replace($_SESSION['user_username'], ' ', $emailAddress); } if ($num_rows >=1) { putenv('TZ=EST5EDT'); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: no-reply@thevault.0sites.net' . "\r\n"; $message .= "A Reply Has Been Made To {$_POST['subject']}.<br /><br />"; $message .= "You are receiving this message because you have subscribed to the topic {$_POST['subject']},<br /> which has a new post since your last one.<br />"; $message .= "Click the link below to view the new thread now.<br />"; $message .= "<a href=\"{$site_root}/index.php?forum={$forum_id}\"> {$site_root}/index.php?forum={$forum_id}&topic={$thread_topic_id}</a><br /> <br />To Unsubscribe from this topic visit the link below.<br /><br /> <a href=\"{$site_root}/subscribe.php?forum={$forum_id}&topic={$topic_id}&uid={$notification_list->user_id}&do=unsubscribe\"> {$site_root}/subscribe.php?forum={$forum_id}&topic={$topic_id}&uid={$notification_list->user_id}&do=unsubscribe</a><br /><br /> Thanks"; $subject = "A Reply Has Been Made To {$_POST['subject']}."; mail($emailAddress,$subject,$message,$headers); } } Hi, ive been looking all over for a script to send an email once users on my site register their details, is this possible? all i want is it to send their username and password. Also the same sort of thing is needed for the "lost password" button? Any help suggested would be great, many thanks. Web Form/Registration: Code: [Select] <form action="sendAd.php" method="post"> <h4 class="style7">Type of company (Removal, Transport, Storage, Insurance, Local Area or Other):<br /> <input type="text" name="type"/> <br />Company name:<br /> <input type="text" name="company_name"/> <br /> Location:<br /> <input type="text" name="location"/> <br /> Six bullet point description of your company:<br /> <textarea rows="6" cols="21" name="description" ></textarea> </h4> <h4 class="style7"> <br /> <input name="submit" type="submit" id="submit" value="List your ad" /> </h4> <p> </p> </form> SendAd.php: Code: [Select] <?PHP $user_name = ""; $password = ""; $database = "removal2"; $server = "server"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "INSERT INTO ads (type, company_name, location, description) VALUES ('" .$type. "', '" .$company_name. "', '" .$location. "', '" .$description. "')"; $result = mysql_query($SQL); mysql_close($db_handle); header( 'Location: http://www.removalspace.com/advert-confirm.php' ); exit(); } else { print "Database NOT Found "; mysql_close($db_handle); } ?> MOD EDIT: code tags added. Dear all, I am using PHPMailer to send notification emails after someone submits the form and as a result I'm receiving an email which has only one line: "A new user has been registered to your website". What I want is to receive an HTML email (in a table format) with all the data in it. Data Field Date January 3, 2010 Name: Aaaaa Surname: BBbbb... Email: test@email.com Gender: male .... .... Which code do I need to add in my thanks.php file in order to do this. After filling all the data in www.domain.com/apply.php, it automatically directs the user to thanks.php file Here is my code (thanks.php): <?php require_once("phpMailer/class.phpmailer.php"); require_once("phpMailer/class.smtp.php"); require_once("phpMailer/language/phpmailer.lang-en.php"); $to_name = "My Website"; $to = "email@mydomain.com"; $subject = "A new user has been registered to my website"; $message = "A new user has been registered to my website"; $message = wordwrap($message,70); $from_name = "My Website"; $from = "email@mydomain.com"; //PHP SMTP version $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.website.org"; $mail->Port =25; $mail->SMTPAuth = false; $mail->Username = "username"; $mail->Password = "password"; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->Subject = $subject; $mail->Body =<<<EMAILBODY A new user has been registered to my website. EMAILBODY; $result = $mail->Send(); echo $result ? 'Thanks for your registering...' : 'Error'; ?> I have subscription system which want to allow people to add personal reminder notes including an email notification. For example, let's say I set up a social networking site based on gardening. Someone can log in and add a reminder that they a revolutionary new lawn mower goes on sale in six weeks time and they want to receive an email on that specific day in six weeks time of this event. I call it 'Gardening Notes' and use it to increase return rate by 50% a members of the gardening social networking site are very satisfied when using it. How would I do this? Does anyone have any advice? Is thier some code I can use to Notifiy me of files that are downloaded from my site. I would like to put some public files (PDF) in a folder to where the public could download what ever, but I want to know who downloaded these files. Dont know much more than that just got the idea from another site cause they new I downloaded a file and I thought it would be a good idea on may site to do something like that. ? Is there an option somewhere in this cesspool infested IPB settings panel? Edited by Monkuar, 23 January 2015 - 10:17 PM. |