0) {
return true;
}
else { return false; }
}
function get_item($myquery, $item_name)
{
$myresult = mysql_query($myquery) or die("query failed " . mysql_error());
if ( check_empty($myresult) ) {
$myrow = mysql_fetch_assoc($myresult);
$myitem = $myrow[$item_name];
mysql_free_result($myresult);
if ($myitem) {
return $myitem;
}
else { return " "; }
}
else {
return "to be updated";
}
}
/* mytopic can be Liverpool, Daydream, Haydoc, Bolton */
function post_text_query($myforum, $mytopic, $mysubject)
{
$myquery = "select phpbb_posts_text.post_text, phpbb_posts.post_time, phpbb_topics.topic_id ";
$myquery .= "from phpbb_posts_text, phpbb_posts, phpbb_topics where ";
$myquery .= "(phpbb_posts_text.post_id = phpbb_posts.post_id) ";
$myquery .= "and (phpbb_posts.topic_id = phpbb_topics.topic_id) ";
$myquery .= "and (phpbb_topics.topic_title = '" .$mytopic ."') ";
$myquery .= "and (phpbb_topics.forum_id = " .$myforum .") ";
$myquery .= "and (phpbb_posts_text.post_subject = '".$mysubject."') ";
$myquery .= "order by phpbb_posts.post_time desc ";
return $myquery;
}
function do_links($mystring)
{
$pos = strpos($mystring, '[url]');
if ( $pos === false ) {
return $mystring;
}
else {
$mypieces = explode(" ", $mystring);
for ( $i = 0; $i < count($mypieces); $i++ ) {
$myval = $mypieces[$i];
$pos = strpos($myval, '[url]');
if ($pos === false) { }
else {
$newstrlen = strlen($myval) - 5 - 6;
$myhref = substr($myval, 5, $newstrlen);
$newpos = strpos($myhref, '/');
if ( $newpos === false ) { $linktxt = $myhref; }
else {
$newstr = $myhref;
$newarr = explode("/", $newstr);
$newsize = count($newarr);
if( $newarr[$newsize - 1] ) {
$linktxt = $newarr[$newsize - 1];
}
else { $linktxt = $newarr[$newsize - 2]; }
}
$mypieces[$i] = "{$linktxt}";
}
}
$newstring = implode(" ", $mypieces);
return $newstring;
}
}
?>
|
|
|
|
|
"src=\"images/dcity.gif\" alt=\"Liverpool Dream\"", 'mailto'=>'malcolm@dream.uk.net');
$info['Daydream'] = array('img'=>"src=\"images/dday.gif\" alt=\"Day-Dream\"", 'mailto'=>'richard@dream.uk.net');
$info['Haydock'] = array('img'=>"src=\"images/dhaydock.gif\" alt=\"Haydock Dream\"", 'mailto'=>'richard@dream.uk.net');
$info['Bolton'] = array('img'=>"src=\"images/dboltonnet.gif\" alt=\"Bolton Day-Dream\"", 'mailto'=>'ruth@dream.uk.net');
foreach ( $info as $key => $value ) { /* loop through hash info */
$subject_arr = array($key, 'next meeting', 'venue', 'directions', 'further info');
foreach ( $subject_arr as $subject_val ) {
$query = post_text_query($forum_id, $key, $subject_val);
$info[$key][$subject_val] = get_item($query, "post_text");
}
$info[$key]['further info'] = do_links($info[$key]['further info']);
$table_str = <<
 |
![]() |
{$info[$key][$key]} |
|
| Next Meeting |
{$info[$key]['next meeting']} |
| Venue |
{$info[$key]['venue']} |
Directions |
| Further info |
{$info[$key]['further info']} |
| Email group leader |
|
DELIM;
$sep_str = <<
 |
DELIM;
echo $table_str;
if ( $key != 'Leigh' ) { echo $sep_str; }
}
mysql_close($link);
?>
 |
|
 |
| |
| For further details, please contact group leaders |
|
 |
|
|
|
|
|
|