Jump to content

Automatic posting script


wookie

Recommended Posts

I have this script working, its an automated posting script for a bulletin board, it posts one set of information, I would like it to post around 30-40 sets of information where position = 0 as in the "WHERE" from the query below. The area where I would like this to show is in the "$msgBody =  $query_results;" part, echo or print does not seem to work for $msgbody.I've gone round in circles this last few days attempting to write alternate queries and such. How can I get this script to produce more than just one result?

 

 

 

<?php

//These three files are needed for this script to work--adjust the path to suit your installation, a URL will not work.
require_once('/home/stev1965/public_html/foru/SSI.php');
require_once('/home/stev1965/public_html/foru/Sources/Post.php');
require_once('/home/stev1965/public_html/foru/Sources/Subs-Post.php');

$query = mysql_query("SELECT cpmsubtitle FROM stev1965_smf14.cpg14x_potdp WHERE position = 0") or die("Error: ".mysql_error());
while($smffetch=mysql_fetch_array($query))

{

	$memberid = $smffetch["cpmsubtitle"];  
	$registerdate= $smffetch["title"];  
                $query_results=$query_results . '<br>' . $memberid . ':  ' . $registerdate;
}


$query_results = $memberid . '<br>' . $registerdate; // builds the message body with the variables created..

$date = date("F j, Y");
$board = '5';  
$msgSubject = $date;

$msgBody =  $query_results;

$msgOptions = array(
	'id' => 0,
	'subject' => $msgSubject,
	'body' => $msgBody,
	'icon' => 'xx', ues
	'smileys_enabled' => 1, 
	'attachments' => empty($attachIDs) ? array() : $attachIDs,
	);
$topicOptions = array(
	'id' => empty($topic) ? 0 : $topic,
	'board' => $board,
	'poll' => null,
	'lock_mode' => 0,
	'sticky_mode' => null,
	'mark_as_read' => true,
	);
$posterOptions = array(
	'id' => $ID_MEMBER,
	'name' => 'Mr. Roboto', 
	'email' => 'webmaster@yourdomain.com', 
	'update_post_count' => 1 
	);

$newTopic = empty($topic) || $topic == 0;  

createPost($msgOptions, $topicOptions, $posterOptions); 

if (isset($topicOptions['id']))
	$topic = $topicOptions['id'];
if ($newTopic)
	notifyMembersBoard();
else
	sendNotifications($topic, 'reply');

?>

 

 

Many thanks!

 

Wookie

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.