Sorry, MaMaMedia.org is experiencing technical difficulties:Cannot connect to database. Please try again later!"; exit; } mysql_query("SET NAMES 'utf8'", $result); if (!@mysql_select_db("myglcap2_mamauy")) return false; return $result; } ?>

< $string

"; } function mergeArrays($aArray, $bArray){ foreach ($bArray as $key=>$value) if (array_key_exists($key, $aArray)) $aArray[$key]=$value; return $aArray; } function validateEmail($email){ if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)){ return 0; }else{ return 1; } } function rowColor($num) { if ($num % 2 == 0) { return "0"; } else { return "1"; } } function isSafari(){ if (strpos($_SERVER['HTTP_USER_AGENT'], "Safari")) return 1; else return 0; } function writewmode(){ if (isSafari()){ echo "wmode=\"transparent\""; } } function writePaginatedLinks($totalitems, $rowsPerPage, $pageNum, $spacer, $otherparams=""){ if ($otherparams !="") $baseurl = "?".$otherparams."&"; else $baseurl = "?"; echo "
"; $num_pages = ceil($totalitems/$rowsPerPage); if ($num_pages > 1){ if ($pageNum > 1) { //only show if not 1st page echo "« Prev $spacer"; }else{ echo "« Prev $spacer"; } for ($i=1;$i<=$num_pages;$i++){ if ($pageNum != $i) echo " $i $spacer"; else echo " $i $spacer"; } if ($pageNum < $num_pages){ $nextpage = $pageNum+1; echo " Next » "; }else{ echo " Next »"; } } echo "
"; } function writePageDescriptionByShortcut($name, $activity, $section, $country, $module, $language, $dblink){ $sql= "SELECT * from page_parent, pages WHERE pp_pageid=page_id AND page_publish=1 AND page_itemname='$name'"; $result = mysql_query($sql, $dblink); $r = mysql_fetch_array($result); $url = "../$country/$module/$language/$section"; if ($activity) $url .= "/".$activity; $url .= "/".$r[page_itemname]; echo "
\n
"; echo ""; echo "\"\""; echo "
"; echo "
$r[page_title]
"; echo "$r[page_desc_sm]
\n\n"; if ($r[page_createdby] <>"") echo "Created by: $r[page_createdby]
\n"; if ($r[page_donatedby] <>"") echo "Donated by: $r[page_donatedby]
\n"; /* if ($r[page_tutorialby] =="") echo "Submit a tutorial
\n"; else */ if ($r[page_tutorialby] <>"") echo "Custom tutorial by: $r[page_tutorialby]
\n"; echo "
\n
"; //clear the row echo "
"; } function writePageDescByShortcut($name ){ global $section; global $language; global $country; global $module; global $dblink; global $path; //$path = $_SERVER['REQUEST_URI']; $sql= "SELECT * from page_parent, pages WHERE pp_pageid=page_id AND page_publish=1 AND page_itemname='$name'"; $result = mysql_query($sql, $dblink); $r = mysql_fetch_array($result); //$url = "../$module/$language/$section"; $url = "../$module"; $page_itemname = $r[page_itemname]; $pageid = $r[page_id]; if ($language != "en"){ $sql= "SELECT * from pages WHERE page_id = (SELECT p_page_id from page_lang_page WHERE p_en_id='$pageid' AND p_lang_code='$language')"; $result = mysql_query($sql, $dblink); if (mysql_affected_rows()) $r = mysql_fetch_array($result); } /* if ($activity) $url .= "/".$activity; //$url .= "/".$r[page_itemname]; */ $url .= $path."/".$page_itemname; //$url = $path."/".$r[page_itemname]; echo "
\n
"; echo ""; echo "\"\""; echo "
"; echo "
$r[page_title]
"; echo "$r[page_desc_sm]

\n\n"; if ($r[page_createdby] <>"") echo "Created by: $r[page_createdby]
\n"; if ($r[page_donatedby] <>"") echo "Donated by: $r[page_donatedby]
\n"; /* if ($r[page_tutorialby] =="") echo "Submit a tutorial
\n"; else */ if ($r[page_tutorialby] <>"") echo "Custom tutorial by: $r[page_tutorialby]
\n"; echo "
\n
"; //clear the row echo "
"; } function writeActivityDescriptionByID($id, $dblink, $country, $module, $language, $section, $activity=""){ $sql= "SELECT * FROM pages WHERE page_id='$id'"; $result = mysql_query($sql, $dblink); $r = mysql_fetch_array($result); $url = "../$country/$module/$language/$section"; if ($activity) $url .= "/".$activity; $url .= "/".$r[page_itemname]; echo "
\n
"; echo ""; echo "\"\""; echo "
"; echo "
$r[page_title]
"; echo "$r[page_desc_sm]

\n\n"; if ($r[page_createdby] <>"") echo "Created by: $r[page_createdby]
\n"; if ($r[page_donatedby] <>"") echo "Donated by: $r[page_donatedby]
\n"; /* if ($r[page_tutorialby] =="") echo "Submit a tutorial
\n"; else */ if ($r[page_tutorialby] <>"") echo "Custom tutorial by: $r[page_tutorialby]
\n"; echo "
\n
"; //clear the row echo "
"; } function writeActivityPromoByShortcut($name, $section, $country, $module, $language, $dblink ){ $sql= "SELECT * from sections, pages WHERE sect_id=page_section AND page_publish=1 AND page_itemname='$name' AND sect_action='$section'"; $result = mysql_query($sql, $dblink); $r = mysql_fetch_array($result); $url = "$module/$language/$section/".$r['page_itemname']; $pageid = $r[page_id]; if ($language != "en"){ $sql= "SELECT * from pages WHERE page_id = (SELECT p_page_id from page_lang_page WHERE p_en_id='$pageid' AND p_lang_code='$language')"; $result = mysql_query($sql, $dblink); if (mysql_affected_rows()) $r = mysql_fetch_array($result); } echo "
\n"; echo "
\n"; echo "\"\""; echo "
"; echo "
".$r['page_title']."
\n"; echo $r['page_desc_sm']."
"; echo "
"; } function writePagePromoByShortcut($name, $country,$module, $language, $section, $activity, $dblink){ $sql= "SELECT * from page_parent, pages WHERE pp_pageid=page_id AND page_publish=1 AND page_itemname='$name'"; $result = mysql_query($sql, $dblink); $r = mysql_fetch_array($result); $url = "../$country/$module/$language/$section"; if ($activity) $url .= "/".$activity; $url .= "/".$r[page_itemname]; echo "
\n"; echo "
\n"; echo "\"\""; echo "
"; echo "
".$r['page_title']."
\n"; echo $r['page_desc_sm']."
"; echo "
"; } ?>