Index: trunk/in-link/module_init.php =================================================================== diff -u -N --- trunk/in-link/module_init.php (revision 12746) +++ trunk/in-link/module_init.php (revision 0) @@ -1,66 +0,0 @@ -_clsLinkList(); - $this->classname = "clsLink"; - } -} - -/* Returns Main Item Collection */ -function &l_ItemCollection() -{ - global $objLinkList; - return $objLinkList; -} - -/* create global link collection object */ - - $objLinkList = new clsLinkList(); //object used to maintain a list of links - - if($l_var_list["id"]) - $objLinkList->SetCurrentItem($l_var_list["id"]); - $objLinkList->Page = $l_var_list["p"]; - -/*if there are customized tags for this module, include them below: */ -$tag_override = $pathtoroot."in-link/customtags.php"; -if(file_exists($tag_override)) -{ - require_once($tag_override); -} - -/* Expire Links */ -$timeZones = array('1' => -12, '2' => -11, '3' => -10, '4' => -9, '5'=> -8, '6' => -7, '7' => -6, '8' => -5, '9' => -4, '10' => -3, '11' => -2, '12' => -1, '13' => 0, '14' => 1, '15' => 2, '16' => 3, '17' => 4, '18' => 5, '19' => 6, '20' => 7, '21' => 8, '22' => 9, '23' => 10, '24' => 11, '25' => 12, '26' => 13); - -$siteZone = $objConfig->Get("Config_Site_Time"); -$serverZone = $objConfig->Get("Config_Server_Time"); -$lastExpire = $objConfig->Get("LastExpirationTime"); - -$diffZone = ($timeZones[$siteZone] < $timeZones[$serverZone]) ? 3600*($timeZones[$serverZone] - $timeZones[$siteZone]) : 0; - -$date = adodb_mktime() - $diffZone; -$nowDate = adodb_date('j-m-y', $date); -$lastExpireDate = $lastExpire? adodb_date('j-m-y', $lastExpire) : 0; - -//echo "DATA: $lastExpire, $nowDate, $lastExpireDate"; - -if (!$lastExpire || ($nowDate != $lastExpireDate)) -{ - $ado = &GetADODBConnection(); - $sql = "UPDATE ".GetTablePrefix()."Link SET Status=0 WHERE Status=1 AND Expire!=0 AND (Expire <=$date)"; - $ado->Execute($sql); - $objConfig->Set("LastExpirationTime", $date, 0, TRUE); - $objConfig->Save(); -} - -?> \ No newline at end of file