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


PHP Projects::get_category_name方法代码示例

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


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

示例1: Projects

	<?php 
require_once "../config.inc.php";
$db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->connect();
$p = new Projects('unknown', BASE_DOMAIN);
$projects = $p->get_projects();
for ($i = 0; $i < count($projects); $i++) {
    $id = $projects[$i]['id'];
    $cat_id = $projects[$i]['project_category_id'];
    $name = $projects[$i]['name'];
    $other = $projects[$i]['other'];
    $vertical_img = $projects[$i]['vertical_img'];
    $bg_img = $projects[$i]['bg_img'];
    $description = $projects[$i]['description'];
    $active = $projects[$i]['active'];
    $cat_name = $p->get_category_name($cat_id);
    echo "<tr id=\"" . $id . "\">";
    // next field client_id
    //not editable
    echo "<td>";
    echo $id;
    echo "</td>";
    //next field name
    echo "<td>";
    echo "<style>\n                 #name_" . $id . ":hover { background: #fffbe1; }\n             </style>";
    echo "<div id=\"edit_" . $projects[$i]['id'] . "\" >\n\t\t\t     \n\t\t\t     <div id=\"name_" . $id . "\" style=>" . $name . "<small> (click to edit) </small></div>\n\t\t             <form>\n\t\t                <input type=\"hidden\" name=\"hiddenField_name_" . $id . "\" value=\"" . $name . "\"/> \n\t\t\t\t\t\t\n\t\t             </form>\n\t\t\t</div>\n\t\t\t\n\t\t\t";
    echo "<script>\n\t\t\tvar replaceWith = \$('<input name=\"temp_name_" . $id . "\" type=\"text\" />'),\n\t\t\t    connectWith = \$('input[name=\"hiddenField_name_" . $id . "\"]'),\n\t\t\t\tfield_name = 'name';\n\t\t\t\tmy_id = " . $id . ";\n\n\t\t\t\$('#edit_" . $id . "').inlineEdit(replaceWith, connectWith, my_id, field_name);\n\t\t\t\n\t\t\t</script>";
    echo "</td>";
    // next field location
    echo "<td>";
    echo "<style>\n\t                 #cat_" . $id . ":hover { background: #fffbe1; }\n\t             </style>";
开发者ID:autonomous019,项目名称:fsi,代码行数:31,代码来源:projects_admin.php

示例2: Projects




<div class="projectIcons">
<?php 
$p = new Projects('member', BASE_DOMAIN);
$results = $p->get_projects();
for ($x = 0; $x < count($results); $x++) {
    $id = $results[$x]['id'];
    $project_category_id = $results[$x]['project_category_id'];
    $name = $results[$x]['name'];
    $description = $results[$x]['description'];
    $other = $results[$x]['other'];
    $bg_img = $results[$x]['bg_img'];
    $vertical_img = $results[$x]['vertical_img'];
    $project_category_name = $p->get_category_name($project_category_id);
    $project_category_name = $project_category_name['name'];
    $project_link = preg_replace('/\\s+/', '_', $project_category_name);
    $project_link = str_replace('-', '_', $project_link);
    $project_category_icon = $p->get_category_icon($project_category_id);
    //$project_category_icon = $project_category_name['icon'];
    if (isset($project_category_icon['icon'])) {
        $project_category_icon = $project_category_icon['icon'];
    } else {
        $project_category_icon = "";
    }
    //echo html here
    echo "<a href=\"?view=pages&project=" . strtolower($project_category_name) . "\" class=\"project-icon\"><span>" . $project_category_name . "</span><img src=\"img/" . $project_category_icon . "\" alt=\"\" style=\"width: 70px; display: inline; margin-top: -40px; \" /></a>";
}
?>
开发者ID:autonomous019,项目名称:fsi,代码行数:27,代码来源:projects_pages.php


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