Forums

easysms issue (1 post)

  1. nate1992
    Member
    Posted 10 months ago #

    I am trying to make adjustments to some code for this plugin to fit my needs. ( Yes its old & out of date plugin but unless you have any new & better ones it works for me ) So first off the code currently will not get the Title & post it in the SMS despite using the original code & many variations of such! ( it also gets an array error )

    So here is what i need, to fix the following part of the code so that A the title shows in the message & B all or part of the post shows in the message

    function easysmspost($post_ID){
    	$postpub = get_option('sms_publish_post');
    	if ($postpub == "yes"){
    		$the_post = get_post($post_ID);
    		if($the_post->post_date_gmt == $the_post->post_modified_gmt)
    		echo
    			$title = stripslashes($post_ID['Title']);
    		echo
    			$sql  = "SELECT * FROM easysms WHERE confirm = 'yes'";
    		echo
    			$result = mysql_query($sql);
    		echo
    			$num_rows = mysql_num_rows($result);
    			while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
    				$sql = "SELECT * from easysms_carriers WHERE ID = '".$row[carrierEmail]."'";
    				$result1 = mysql_query($sql);
    				while($row1 = mysql_fetch_array($result1, MYSQL_ASSOC)){
    					$from = "From: ". get_option('sms_from_name') . " <" . get_option('sms_from_email') . ">\r\n";
    					$subject = "New post at ".get_bloginfo('name')." ";
    					$message = $title." - Visit ".get_bloginfo('url');
    					$to = $row['phoneNumber']."@".$row1["carrierEmail"];
    					mail($to, $subject, $message, $from);
    				}
    			}

Reply

You must log in to post.

About this Topic