当前位置: 首页>>代码示例>>PHP>>正文


PHP Ad::activate方法代码示例

本文整理汇总了PHP中Ad::activate方法的典型用法代码示例。如果您正苦于以下问题:PHP Ad::activate方法的具体用法?PHP Ad::activate怎么用?PHP Ad::activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ad的用法示例。


在下文中一共展示了Ad::activate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: date

 }
 if ($success) {
     $ipaddr = $_SERVER['REMOTE_ADDR'];
     if (UserBanned::exists(0, array(), "(email='{$p_email}' OR ipaddr='{$ipaddr}')")) {
         $last = 666666;
     } else {
         $postedon = date("Y-m-d H:i:s", time());
         $expiry = date("Y-m-d", time() + $p_expiry * 24 * 60 * 60);
         $code = md5(uniqid(rand(), true));
         if (User::is_logged_in()) {
             $p_name = User::get_name();
             $p_email = User::get_email();
         }
         $last = Ad::create(array('user_id' => User::get_id(), 'name' => $p_name, 'email' => $p_email, 'telephone' => $p_telephone, 'title' => $p_title, 'description' => $p_description, 'picture' => $p_picture, 'category' => $p_category, 'price' => $p_price, 'city' => $p_city, 'region' => $p_region, 'expiry' => $expiry, 'webpage' => $p_webpage, 'code' => $code, 'ipaddr' => $ipaddr, 'postedon' => $postedon, 'lastmodified' => $postedon));
         if (User::is_logged_in()) {
             Ad::activate($last);
         } else {
             if (!($user_exists = User::exists(0, array('email' => $p_email)))) {
                 $p_em = explode('@', $p_email);
                 $username = substr($p_em[0], 0, 6);
                 $active = 0;
                 $createdon = date("Y-m-d H:i:s", time());
                 $password = substr($code, 0, 6);
                 $userid = User::create(array('email' => $p_email, 'username' => $username, 'password' => $password, 'name' => $p_name, 'active' => $active, 'createdon' => $createdon, 'ipaddr' => $ipaddr, 'code' => $code));
                 $registration_message = StaticContent::get_content('user-registration-email');
                 eval("\$registration_message = \"{$registration_message}\";");
             } else {
                 $user = User::get_one(0, array('email' => $p_email));
                 $username = $user['username'];
             }
             $ad_activation_message = StaticContent::get_content('ad-activation-email');
开发者ID:noverkill,项目名称:classified-ads-script,代码行数:31,代码来源:ad-placement.php

示例2: isset

 <?php 
/**
 * Classified-ads-script
 * 
 * @copyright  Copyright (c) Szilard Szabo
 * @license    GPL v3
 * @package    Frontend
 */
include "./admin/include/common.php";
$g_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$g_code = isset($_GET['code']) ? trim(strip_tags($_GET['code'])) : '';
$success = true;
$errors = array();
if ($g_id < 1) {
    $success = false;
}
if ($g_code == '') {
    $success = false;
}
if ($success) {
    if (!Ad::activate($g_id, $g_code)) {
        $success = false;
    }
}
include "./templates/ad-activation.php";
开发者ID:noverkill,项目名称:classified-ads-script,代码行数:25,代码来源:ad-activation.php


注:本文中的Ad::activate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。