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


PHP hook_filter函数代码示例

本文整理汇总了PHP中hook_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP hook_filter函数的具体用法?PHP hook_filter怎么用?PHP hook_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: isset_user

function isset_user($id)
{
    global $hmuser;
    hook_action('isset_user');
    $return = $hmuser->isset_user($id);
    $return = hook_filter('isset_user', $return);
    return $return;
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:8,代码来源:user.php

示例2: register_dashboard_box

/** Đăng ký dashboard box */
function register_dashboard_box($args = array())
{
    hook_filter('before_register_dashboard_box', $args);
    hook_action('register_dashboard_box');
    global $dashboard_box;
    if (is_array($args)) {
        $dashboard_box[] = $args;
    }
}
开发者ID:hoamaisoft,项目名称:hoamai-cms-beta-1.0,代码行数:10,代码来源:dashboard_model.php

示例3: total_module

function total_module($args = array())
{
    hook_filter('before_total_module', $args);
    global $hmmodule;
    hook_action('total_module');
    $return = $hmmodule->total_module($args);
    $return = hook_filter('total_module', $return);
    return $return;
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:9,代码来源:module.php

示例4: hook_filter

    hook_filter('before_register_menu_location', $args);
    global $hmmenu;
    hook_action('register_menu_location');
    $return = $hmmenu->register_menu_location($args);
    $return = hook_filter('register_menu_location', $return);
    return $return;
}
function menu_location($menu_location_name = NULL)
{
    hook_filter('before_menu_location', $menu_location_name);
    global $hmmenu;
    hook_action('menu_location');
    $menu_location = $hmmenu->menu_location;
    if (isset($menu_location[$menu_location_name])) {
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:14,代码来源:menu.php

示例5: chapter_show_data

function chapter_show_data($id)
{
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    hook_action('chapter_show_data');
    if (!$hmdb->Query("SELECT * FROM " . DB_PREFIX . "content WHERE `status` = 'chapter' AND `parent` = '{$id}' ORDER BY id DESC")) {
        $hmdb->Kill();
    }
    $array_cha = array();
    while ($row = $hmdb->Row()) {
        $data_cha = content_data_by_id($row->id);
        $array_cha[] = array('id' => $row->id, 'name' => $row->name, 'slug' => $row->slug, 'public_time' => date('d-m-Y H:i', $data_cha['field']['public_time']));
    }
    $array['chapter'] = $array_cha;
    return hook_filter('chapter_show_data', json_encode($array, TRUE));
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:15,代码来源:chapter_model.php

示例6: hook_filter

    <center><a href="index.php"><img src="images/headerlogo.png"></a></center>
        <div class="menu">
            <div class="menu-wrap">
                <ul id="main_menu">
                    <?php 
if (!isset($data)) {
    ?>
                    <li><a href="register.php">Register</a></li>
                    <?php 
} else {
    ?>
                    <li>
                        <a href="#">Earn Coins</a>
                        <ul>
                            <?php 
    $menu = hook_filter('top_menu_earn', "");
    echo $menu;
    ?>
                        </ul>
                    </li>
                    <?php 
}
?>
                    <li><a href="faq.php">FAQ</a></li>
                    <li><a href="contact.php">Contact</a></li>
                    <li><a href="stats.php">Stats</a></li>
                    <?php 
if (isset($data) && $data->admin == 1) {
    ?>
                    <li><a href="admin-panel/settings.php">Admin Panel</a></li>
                    <?php 
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:header.php

示例7: CPC

    ?>
</div>
        <?php 
}
?>
        <form class="sideform" method="post">
            CPC (Cost Per Click) (2 - infinite)<br/>
            <input name="cpc" type="text" value="<?php 
echo $site->cpc;
?>
"/><br/><br/>
            Referral Bonus (0 - 1)<br/>
            <input name="refbonus" type="text" value="<?php 
echo $site->refbonus;
?>
"/><br/><br/>
            Coins Discount (0 - 1)<br/>
            <input name="sale" type="text" value="<?php 
echo $site->sale;
?>
"/><br/><br/>
            <?php 
$settings = hook_filter('admin_settings', "");
echo $settings;
?>
            <input style="width:100%;" type="Submit"/>
        </form>
    </div>
</div>
<?php 
include 'footer.php';
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:settings.php

示例8: hook_filter

        <?php 
    }
    if (isset($warning)) {
        ?>
        <div class="warning">WARNING: <?php 
        echo $warning;
        ?>
</div>
        <?php 
    }
    ?>
        
        <form class="contentform" method="post">
            Type<br/>
            <select name="type"><?php 
    $select = hook_filter('add_site_select', "");
    echo $select;
    ?>
</select><br/><br/>
            Link<br/>
            <input name="url" type="text" value="<?php 
    if (isset($posts["url"])) {
        echo $posts["url"];
    }
    ?>
"/><br/><br/>
            Title<br/>
            <input name="title" type="text" value="<?php 
    if (isset($posts["title"])) {
        echo $posts["title"];
    }
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:addsite.php

示例9: rand

 $id = $id[count($id) - 1];
 $key = rand(10000, 20000);
 $url = "http://services.digg.com/1.0/endpoint?method=fan.getAll&username=" . $id . "&count=" . $key;
 $page = get_data($url);
 $plused1 = mysql_query("SELECT * FROM `dugg` WHERE `site_id`='{$posts['him']}' AND `user_id`='{$posts['me']}'");
 $plused = mysql_num_rows($plused1);
 $x = $data3->digg;
 if ($page == FALSE) {
     echo "Error: Keine Verbindung zu Digg! Bitte versuchen sie es später!";
 } else {
     if ($plused > 0) {
         echo "Error: Sie haben diesen Benutzer bereits geDiggt!";
     } else {
         if (preg_match("/{$x}/i", $page)) {
             $coins = number_format($site2->cpc - 1);
             $bonuscoins = hook_filter('bonus_coins', $coins);
             mysql_query("UPDATE `users` SET `coins`=`coins`+'{$bonuscoins}' WHERE `id`='{$posts['me']}'");
             mysql_query("UPDATE `digg` SET `exchanges`=`exchanges`+'1' WHERE `id`='{$posts['him']}'");
             mysql_query("UPDATE `users` set `coins`=`coins`-'{$site2->cpc}' WHERE `id`='{$site2->user}'");
             mysql_query("INSERT INTO `dugg` (user_id, site_id) VALUES('{$posts['me']}', '{$posts['him']}')");
             $aff1 = mysql_query("SELECT ref FROM `users` WHERE `id`='{$posts['me']}'");
             $aff = mysql_fetch_object($aff1);
             if ($aff->ref > 0) {
                 $coins = $coins * $site->refbonus;
                 mysql_query("UPDATE `users` SET `coins`=`coins`+'{$coins}' WHERE `id`='{$aff->ref}'");
             }
             echo "Sie haben den Digg abgeschlossen.Sie erhalten {$coins} Coins!";
         } else {
             echo "ERROR: Digg meldet: Sie haben den Digg nicht abgeschlossen. Bitte schließen sie den Digg erst ab!";
         }
     }
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:complete.php

示例10: create_image

/** Cắt ảnh theo cỡ tùy chọn */
function create_image($args)
{
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    hook_filter('before_create_image', $args);
    hook_action('create_image');
    if (!is_array($args)) {
        parse_str($args, $args);
    }
    $file_id = $args['file'];
    if (isset_image($file_id)) {
        $row = get_file_data($file_id);
        $file_info = json_decode($row->file_info);
        $file_dst_name_body = $file_info->file_dst_name_body;
        $file_dst_name_ext = $file_info->file_dst_name_ext;
        $source_file = get_file_location($file_id);
        $crop_name = $file_dst_name_body . '-' . $args['w'] . 'x' . $args['h'] . '.' . $file_dst_name_ext;
        if (file_exists(get_file_location($file_id, FALSE) . $crop_name)) {
            return get_file_url($file_id, FALSE) . $crop_name;
        } else {
            /** resize file */
            /* fix func exif_imagetype not avaiable */
            $type = getimagesize($source_file);
            $type = $type['mime'];
            switch ($type) {
                case 'image/png':
                    $type = IMAGETYPE_PNG;
                    break;
                case 'image/jpeg':
                    $type = IMAGETYPE_JPEG;
                    break;
                case 'image/gif':
                    $type = IMAGETYPE_GIF;
                    break;
                case 'image/bmp':
                    $type = IMAGETYPE_BMP;
                    break;
                case 'image/x-ms-bmp':
                    $type = IMAGETYPE_BMP;
                    break;
            }
            /* fix func exif_imagetype not avaiable */
            switch ($type) {
                case 1:
                    $source = imageCreateFromGif($source_file);
                    break;
                case 2:
                    $source = imageCreateFromJpeg($source_file);
                    break;
                case 3:
                    $source = imageCreateFromPng($source_file);
                    break;
                case 6:
                    $source = imageCreateFromBmp($source_file);
                    break;
            }
            /** resize file gốc về cùng 1 cỡ */
            $size = getimagesize($source_file);
            $source_width = $size[0];
            $source_height = $size[1];
            $fix_width = $args['w'];
            $fix_height = $args['h'];
            $thumb = imagecreatetruecolor($fix_width, $fix_height);
            /* Fix black background */
            $white = imagecolorallocate($thumb, 255, 255, 255);
            imagefill($thumb, 0, 0, $white);
            /* Fix black background */
            /* fix quality with imagecopyresampled , repalce imagecopyresized */
            imagecopyresampled($thumb, $source, 0, 0, 0, 0, $fix_width, $fix_height, $source_width, $source_height);
            $saveto = get_file_location($file_id, FALSE) . $crop_name;
            imagejpeg($thumb, $saveto, 100);
            return get_file_url($file_id, FALSE) . $crop_name;
        }
    } else {
        return FALSE;
    }
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:77,代码来源:media.php

示例11: while

if (isset($_SESSION["id"])) {
    $loggedIn = true;
    $result = $connection->query('SELECT * FROM users WHERE id = "' . $_SESSION["id"] . '";');
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            $username = $row["name"];
            $id = $row['id'];
        }
    } else {
        $cannotFind = true;
    }
} else {
    $loggedIn = false;
}
$isAdmin = false;
if (isset($_SESSION['privledge']) && $_SESSION['privledge'] == 10) {
    $isAdmin = true;
}
$loader = new Twig_Loader_Filesystem(__DIR__ . '/../template');
$twig = new Twig_Environment($loader, array('debug' => true));
$twig->addExtension(new Twig_Extension_Debug());
$twig->addExtension(new Twig_Extensions_Extension_I18n());
$navbar_links = array();
$additional_g_navbar_content = array();
$additional_g_navbar_content = hook_filter('add_guest_navbar_content', $additional_g_navbar_content);
$additional_l_navbar_content = array();
$additional_l_navbar_content = hook_filter('add_loggedin_navbar_content', $additional_l_navbar_content);
$additional_sitename_content = array();
$additional_sitename_content = hook_filter('add_sitename_navbar_content', $additional_sitename_content);
hook_action('before_render');
echo $twig->render('header.twig', array('root_url' => ROOT_URL, 'site_name' => BOARD_NAME, 'user' => array('id' => $id, 'name' => $username), 'isAdmin' => $isAdmin, 'isLoggedIn' => $loggedIn, 'additional_guest_navbar_content' => $additional_g_navbar_content, 'additional_loggedin_navbar_content' => $additional_l_navbar_content, 'additional_sitename_content' => $additional_sitename_content));
开发者ID:admicos,项目名称:ffaboard,代码行数:31,代码来源:header.php

示例12: taxonomy_checkbox_list

function taxonomy_checkbox_list($args = array())
{
    hook_action('taxonomy_checkbox_list');
    hook_filter('taxonomy_checkbox_list_before', $args);
    global $hmtaxonomy;
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    @($key = $args['key']);
    @($parent = $args['parent'] ? $args['parent'] : 0);
    @($default_value = $args['default_value']);
    @($object_id = $args['object_id']);
    if (is_numeric($object_id)) {
        $tableName = DB_PREFIX . "relationship";
        $whereArray = array('object_id' => MySQL::SQLValue($object_id), 'relationship' => MySQL::SQLValue('contax'));
        $hmdb->SelectRows($tableName, $whereArray);
        while ($row = $hmdb->Row()) {
            $default_value[] = $row->target_id;
        }
    }
    if (!is_array($default_value)) {
        $default_value = array();
    }
    $tax = $hmtaxonomy->hmtaxonomy;
    if (isset($tax[$key])) {
        $tableName = DB_PREFIX . "taxonomy";
        $whereArray = array('key' => MySQL::SQLValue($key), 'parent' => MySQL::SQLValue($parent), 'status' => MySQL::SQLValue('public'));
        $hmdb->SelectRows($tableName, $whereArray);
        if ($hmdb->HasRecords()) {
            if ($parent != 0) {
                echo '<ul class="taxonomy_tree_sub_group taxonomy_tree_sub_group_of_' . $parent . '">';
            }
            while ($row = $hmdb->Row()) {
                $taxs[] = $row;
            }
            foreach ($taxs as $tax) {
                if (in_array($tax->id, $default_value)) {
                    $checked = 'checked';
                } else {
                    $checked = '';
                }
                echo '<li data-id="' . $tax->id . '" data-slug="' . $tax->slug . '" class="tax_tree_item tax_tree_item_' . $tax->id . '">';
                echo '<input type="checkbox" name="taxonomy[]" value="' . $tax->id . '" ' . $checked . ' /> ';
                echo '<label>' . $tax->name . '</label>';
                taxonomy_checkbox_list(array('key' => $key, 'parent' => $tax->id, 'default_value' => $default_value));
                echo '</li>';
            }
            if ($parent != 0) {
                echo '</ul>';
            }
        }
    }
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:51,代码来源:taxonomy_model.php

示例13: hook_filter

    <div class="head"><center>Welcome to <?php 
    echo $site->site_name;
    ?>
</center></div>
    <div class="contentinside">
        <center>
            <b><?php 
    echo $site->site_name;
    ?>
 is a system that will help you increase your social presence for FREE.  We allow you to pick and choose who you want to exchange with and skip those who you're not interested in.</b></font><br><br>
            <br/>
            <font size="2" color="blue"><b>You Like Hits helps you to increase all of the following:</b></font><br/><br/>
            <table width="100%">
                <tr style="font-size:13px;">
                    <?php 
    $icons = hook_filter('index_icons', "");
    echo $icons;
    ?>
                    <!--<td align="center" width="14%" valign="top"><img src="60/newsvine.png" alt="And MORE"><br><b>And MORE</b></td>-->
                </tr>
            </table>
            <br/>
            <br/>
            
        </center>
        <br/><center>
        <p><b>Only exchange who and what you're interested in!</b></p>
        <ul>
        <li><font><b> We don't sell exchanges.</b></font></li>
        <li><font><b> We abide by all Social Network Policies.</li>
        <li><font><b> We don't ask for your account passwords.</b></font></li>
开发者ID:danielheyman,项目名称:SocialExchangeScript,代码行数:31,代码来源:index.php

示例14: input_editor

function input_editor($field_array = array())
{
    hook_action('input_editor');
    $field_array = hook_filter('input_editor_input', $field_array);
    $return = '';
    if ($field_array['addClass'] != NULL) {
        $addClass = $field_array['addClass'];
    } else {
        $addClass = 'wysiwyg';
    }
    $default_value = $field_array['default_value'];
    $default_value = str_replace('&lt;', '&amp;lt;', $default_value);
    $default_value = str_replace('&gt;', '&amp;gt;', $default_value);
    $default_value = str_replace('<pre>', '&lt;pre&gt;', $default_value);
    $default_value = str_replace('</pre>', '&lt;/pre&gt;', $default_value);
    $return = $return . '<div class="form-group">' . "\n";
    if ($field_array['handle']) {
        $return = $return . '	<div class="form-group-handle"></div>';
    }
    $return = $return . '	<label for="' . $field_array['name'] . '">' . $field_array['nice_name'] . '</label>' . "\n";
    $return = $return . '	<button id="' . $field_array['name'] . '" multi="false" imageonly="true" type="button" class="btn btn-default media_btn btn-xs" data-toggle="modal" data-target="#media_box_modal">' . "\n";
    $return = $return . '		<span class="glyphicon glyphicon-picture"></span> ' . _('Thư viện') . "\n";
    $return = $return . '	</button>' . "\n";
    $return = $return . '	<p class="input_description">' . $field_array['description'] . '</p>' . "\n";
    $return = $return . '	<textarea ' . $field_array['required'] . ' name="' . $field_array['name'] . '" class="' . $addClass . '" id="' . $field_array['name'] . '">' . $default_value . '</textarea>' . "\n";
    $return = $return . '</div>' . "\n";
    $return = hook_filter('input_editor_output', $return);
    return $return;
}
开发者ID:hoamaisoft,项目名称:hoamai-cms-beta-1.0,代码行数:29,代码来源:functions.php

示例15: die

    $category = null;
}
$page2 = $page - 1;
$page3 = $page + 1;
$result = $connection->query('SELECT * FROM topic WHERE category_id = ' . $connection->real_escape_string($_GET['id']) . ' ORDER BY id DESC LIMIT ' . $page2 * PAGE_LIMIT . ',' . $page * PAGE_LIMIT . ' ;') or die("error: " . $connection->error);
if ($result->num_rows > 0) {
    $rows = $result->num_rows;
    while ($row = $result->fetch_assoc()) {
        $topics[$row['id']] = $row;
        $topics[$row['id']]['preview'] = $bbcode->stripBBCodeTags(strlen($row['content']) > SMALL_DESC_LIMIT ? substr($row['content'], 0, SMALL_DESC_LIMIT - 3) . '...' : $row['content']);
        $topics[$row['id']]['last_updated'] = date('d/m/y G:i', strtotime($row['last_updated']));
        $result2 = $connection->query('SELECT * FROM users WHERE id = ' . $row['author_id']);
        if ($result2->num_rows > 0) {
            while ($row2 = $result2->fetch_assoc()) {
                $topics[$row['id']]['author_name'] = $row2['name'];
            }
        }
    }
} else {
    $topics = null;
}
$additional_cat_admin_buttons = array();
$additional_cat_admin_buttons = hook_filter('add_category_admin_buttons', $additional_cat_admin_buttons);
$additional_cat_user_buttons = array();
$additional_cat_user_buttons = hook_filter('add_category_user_buttons', $additional_cat_user_buttons);
$additional_stuff_before_topics = array();
$additional_stuff_before_topics = hook_filter('add_stuff_before_topics', $additional_stuff_before_topics);
$additional_stuff_before_pages = array();
$additional_stuff_before_pages = hook_filter('add_stuff_before_pages', $additional_stuff_before_pages);
echo $twig->render('category.twig', array('siteName' => BOARD_NAME, 'isAdmin' => $isAdmin, 'isLoggedIn' => $loggedIn, 'category' => $category, 'topics' => $topics, 'additional_category_admin_buttons' => $additional_cat_admin_buttons, 'additional_category_user_buttons' => $additional_cat_user_buttons, 'before_topics' => $additional_stuff_before_topics, 'before_pages' => $additional_stuff_before_pages));
include_once 'include/footer.php';
开发者ID:admicos,项目名称:ffaboard,代码行数:31,代码来源:category.php


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