Esempio n. 1
0
 function _init_class_displays()
 {
     $class = isset($this->_source_criteria['class']) && $this->_source_criteria['class'] ? $this->_source_criteria['class'] : false;
     if (!($class && is_array($class))) {
         return false;
     }
     $class_display_criteria = $this->_source_criteria;
     // class groups dont show content that also has a tag to be listed
     $tag = isset($this->_source_criteria['tag']) && $this->_source_criteria['tag'] ? $this->_source_criteria['tag'] : false;
     if ($tag && is_array($tag)) {
         unset($class_display_criteria['tag']);
         $class_display_criteria['not_tag'] = $tag;
     }
     require_once 'AMP/Content/Class.inc.php';
     foreach ($class as $class_group) {
         $source = new ContentClass(AMP_Registry::getDbcon(), $class_group);
         $class_display_criteria['class'] = $class_group;
         $class_display = new $this->_grouped_list_class($null = 0, $class_display_criteria, $source->getListItemLimit());
         $class_display->set_container($source);
         $class_display->_class_pager = 'AMP_Display_Pager_Morelinkplus';
         $class_display->_path_pager = 'AMP/Display/Pager/Morelinkplus.php';
         $class_display->set_pager_limit($this->_pager_limit, 'first');
         if (!empty($this->_source_criteria['section'])) {
             $class_display->set_pager_request(array('type' => $this->_source_criteria['section'], 'class' => $class_group, 'list' => 'class'));
         } else {
             $class_display->set_pager_request(array('class' => $class_group, 'list' => 'class'));
         }
         $this->_group_displays['classes'][$class_group] = $class_display;
     }
 }
Esempio n. 2
0
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    For further information, contact Radical Designs at info@radicaldesigns.org

*******************************************/
$intro_id = 2;
require_once "AMP/BaseDB.php";
//if the frontpage timeout is actually set it will have a different value from the CACHE_TIMEOUT
//otherwise no one cares about this case
if (($cached_output = AMP_cached_request()) && AMP_SYSTEM_CACHE_TIMEOUT_FRONTPAGE == AMP_SYSTEM_CACHE_TIMEOUT || $cached_output && ($cached_frontpage_stamp = AMP_cache_get(AMP_CACHE_TOKEN_URL_CONTENT . '_TIMESTAMP_FRONTPAGE')) && AMP_SYSTEM_CACHE_TIMEOUT_FRONTPAGE >= time() - $cached_frontpage_stamp) {
    print $cached_output;
    exit;
}
require_once "AMP/BaseTemplate.php";
if ('index.php' != AMP_CONTENT_URL_FRONTPAGE) {
    ampredirect(AMP_CONTENT_URL_FRONTPAGE);
}
$currentPage =& AMPContent_Page::instance();
$currentPage->setListType(AMP_CONTENT_LISTTYPE_FRONTPAGE);
require_once 'AMP/Content/Class.inc.php';
$currentClass = new ContentClass(AMP_Registry::getDbcon(), AMP_CONTENT_CLASS_FRONTPAGE);
$display =& $currentClass->getDisplay();
$currentPage->contentManager->addDisplay($display);
AMP_cache_set(AMP_CACHE_TOKEN_URL_CONTENT . '_TIMESTAMP_FRONTPAGE', time());
require_once 'AMP/BaseFooter.php';
Esempio n. 3
0
            exit;
        } else {
            echo json_encode(array('result' => 'failed', 'msg' => '数据库错误'));
            exit;
        }
    }
    SystemTool::systemLog($db, '分享统计错误', '参数错误,缺少参数', $_SERVER['REMOTE_ADDR'] . print_r($_POST, true));
    echo json_encode(array('result' => 'failed', 'msg' => '参数错误'));
    exit;
}
//处理分享点击统计
if (isset($_POST['action']) && $_POST['action'] == 'clickshare') {
    $contentid = intval($_POST['id']);
    $clickOpenid = $_SESSION['openid'];
    $shareOpenid = trim($_POST['shareopenid']);
    $contentinfo = ContentClass::getArticle($db, $contentid);
    if (!empty($contentid) && !empty($clickOpenid) && !empty($shareOpenid) && $clickOpenid != $shareOpenid) {
        if ($contentinfo === false) {
            SystemTool::systemLog($db, '点击统计错误', '内容不存在', $_SERVER['REMOTE_ADDR'] . print_r($_POST, true));
            echo '0';
            exit;
        }
        //点击价格
        $clickprice = rand($contentinfo['minprice'] * 100, $contentinfo['maxprice'] * 100);
        if ($clickprice / 100 > $contentinfo['leftmoney']) {
            $clickprice = $contentinfo['leftmoney'];
        } else {
            $clickprice = floatval($clickprice / 100);
        }
        //位置信息
        $addressinfo = array();
Esempio n. 4
0
 function findClass($class_id)
 {
     $location = new ContentClass($this->dbcon, $class_id);
     $this->current_section = $location->getSection();
     $this->current_element = $this->_trimText($location->getName());
     $this->content_type = AMP_CONTENT_PAGETYPE_LIST;
 }
Esempio n. 5
0
 /**
  * set the ContentClass for use on the current page 
  * 
  * @param   integer   $class_id     The database id of the ContentClass to use 
  * @access  public
  * @since   3.5.3
  * @return  void
  */
 function setClass($class_id)
 {
     require_once 'AMP/Content/Class.inc.php';
     $contentClass = new ContentClass($this->dbcon, $class_id);
     if (!$contentClass->hasData()) {
         return false;
     }
     $this->class =& $contentClass;
     $this->section_id = $contentClass->getSection();
     $this->_globalizePageVars();
 }