createOption('DefautMode', _UPDATETIME_DEFAULT_MODE, 'select', '1', _UPDATETIME_DEFAULT_MODE_VALUE); $this->createOption('BeforeTime', _UPDATETIME_BEFORE_TIME, 'text', _UPDATETIME_BEFORE_TIME_VALUE); $this->createOption('AfterTime', _UPDATETIME_AFTER_TIME, 'text', _UPDATETIME_AFTER_TIME_VALUE); $this->createOption('Locale', _UPDATETIME_DATE_LOCALE, 'text', 'ja_JP.' . _CHARSET); $this->createOption('DateFormat', _UPDATETIME_DATE_FORMAT, 'text', '%Y-%m-%d %H:%M:%S'); $this->createOption('sLists', _UPDATETIME_S_LISTS, 'text', '
Could not save data: ' . $res; } return ''; } function doSkinVar($skinType, $maxtoshow = 5, $bmode = 'current') { global $manager, $CONF, $blogid; if (is_numeric($blogid)) { $blogid = intval($blogid); } else { $blogid = gttBlogIDFromName($blogid); } if (!$blogid) { $blogid = $CONF['DefaultBlog']; } $b =& $manager->getBlog($blogid); $this->defaultBlogURL = $b->getURL() ; if (!$this->defaultBlogURL) { $this->defaultBlogURL = $CONF['IndexURL']; } if ($maxtoshow == '') { $maxtoshow = 5; } if ($bmode == '') { $bmode = 'current'; } echo $this->getOption('sLists') . "\n"; $query = 'SELECT' . ' r.up_id as up_id, ' . ' IF(INTERVAL(r.updatetime, i.itime), UNIX_TIMESTAMP(r.updatetime), UNIX_TIMESTAMP(i.itime)) as utime ' . 'FROM ' . sql_table('plugin_rectime') . ' as r, ' . sql_table('item') . ' as i ' . 'WHERE' . ' r.up_id=i.inumber'; if ($bmode != 'all') { $query .= ' and i.iblog=' . intval($blogid); } $query .= ' ORDER BY utime DESC' . ' LIMIT 0, ' . intval($maxtoshow); $res = sql_query($query); while ($row = mysql_fetch_object($res)) { $item =& $manager->getItem($row->up_id, 0, 0); if ($item) { $itemlink = $this->createGlobalItemLink($item['itemid']); $itemtitle = strip_tags($item['title']); $itemtitle = shorten($itemtitle,26,'..'); $itemdate = date('m/d H:i',$row->utime); $printData = $this->getOption('sItems') . "\n" . '' . htmlspecialchars($itemtitle, ENT_QUOTES, _CHARSET) .' ' . $itemdate . "\n" . $this->getOption('eItems') . "\n"; echo $printData; } } echo $this->getOption('eLists'); } function doTemplateVar(&$item) { setlocale(LC_TIME, $this->getOption('Locale')); $query = 'SELECT' . ' r.up_id,' . ' UNIX_TIMESTAMP(r.updatetime) as updatetime,' . ' UNIX_TIMESTAMP(i.itime) as itemtime ' . 'FROM ' . sql_table('plugin_rectime') . ' as r, ' . sql_table('item') . ' as i ' . 'WHERE' . ' r.up_id = ' . intval($item->itemid) . ' and r.up_id = i.inumber'; $res = sql_query($query); if ($row = mysql_fetch_assoc($res)) { // $data['utime'] = date($this->getOption('DateFormat'), $row['updatetime']); $data['utime'] = strftime($this->getOption('DateFormat'), $row['updatetime']); if ($row['updatetime'] > $row['itemtime']) { echo TEMPLATE::fill($this->getOption('AfterTime'), $data); } elseif ($row['updatetime'] < $row['itemtime']) { echo TEMPLATE::fill($this->getOption('BeforeTime'), $data); } } } function createGlobalItemLink($itemid, $extra = '') { global $CONF, $manager; /* if ($CONF['URLMode'] == 'pathinfo') { $link = $CONF['ItemURL'] . '/item/' . $itemid; }else{ $blogid = getBlogIDFromItemID($itemid); $b_tmp =& $manager->getBlog($blogid); $blogurl = $b_tmp->getURL() ; if(!$blogurl){ $blogurl = $this->defaultBlogURL; } if(substr($blogurl, -4) != '.php'){ if(substr($blogurl, -1) != '/') $blogurl .= '/'; $blogurl .= 'index.php'; } $link = $blogurl . '?itemid=' . $itemid; } return addLinkParams($link, $extra);*/ $blogid = getBlogIDFromItemID($itemid); $b_tmp =& $manager->getBlog($blogid); $blogurl = $b_tmp->getURL() ; if (!$blogurl) { $blogurl = $this->defaultBlogURL; } if (substr($blogurl, -4) != '.php') { if(substr($blogurl, -1) != '/') $blogurl .= '/'; $blogurl .= 'index.php'; } if (($CONF['URLMode'] == 'pathinfo') && (substr($blogurl, -4) == '.php')) { $originalURLMode = $CONF['URLMode']; $CONF['URLMode'] = 'normal'; } $originalItemURL = $CONF['ItemURL']; $CONF['ItemURL'] = $blogurl; $link = createItemLink($itemid, $extra); $CONF['ItemURL'] = $originalItemURL; if ($CONF['URLMode'] <> $originalURLMode) { $CONF['URLMode'] = $originalURLMode; } return $link; } }