本文整理汇总了PHP中add_link函数的典型用法代码示例。如果您正苦于以下问题:PHP add_link函数的具体用法?PHP add_link怎么用?PHP add_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: make_links_section
function make_links_section($section_data)
{
global $tpl;
$tpl->assign("DESC_TITLE", make_anchor($section_data["NAME"], $section_data["TARGET"]));
foreach ($section_data["LINKS"] as $link) {
if ($link["LINK_TYPE"] == 0) {
add_link($link["LINK_NAME"], $link["LINK_URL"], $link["LINK_TIP"], $link["LINK_DESC"]);
} else {
add_logo_link($link["LINK_NAME"], $link["LINK_URL"], $link["LINK_LOGO"], $link["LINK_DESC"]);
}
}
$tpl->assign("ICON", image("Up arrow", "uparrow.png"));
// Write out the section
$tpl->parse("ROWS", ".linksection");
// Close the section, in preparation for a possible new section
$tpl->clear("LINKLIST");
}
示例2: show_text
function show_text($str)
{
$str = html_transfer($str);
$str = Markdown($str);
$str = add_link($str);
return $str;
}
示例3: check_admin_referer
check_admin_referer('bulk-bookmarks');
//for each link id (in $linkcheck[]) change category to selected value
if (count($linkcheck) == 0) {
wp_redirect($this_file);
exit;
}
$all_links = join(',', $linkcheck);
// should now have an array of links we can change
//$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
wp_redirect($this_file);
exit;
break;
case 'add':
check_admin_referer('add-bookmark');
$redir = wp_get_referer();
if (add_link()) {
$redir = add_query_arg('added', 'true', $redir);
}
wp_redirect($redir);
exit;
break;
case 'save':
$link_id = (int) $_POST['link_id'];
check_admin_referer('update-bookmark_' . $link_id);
edit_link($link_id);
wp_redirect($this_file);
exit;
break;
case 'delete':
$link_id = (int) $_GET['link_id'];
check_admin_referer('delete-bookmark_' . $link_id);
示例4: setcookie
$db->query('UPDATE ' . $ecs->table('goods') . " SET original_img='' WHERE `goods_id`='{$goods_id}'");
$db->query('UPDATE ' . $ecs->table('goods_gallery') . " SET img_original='' WHERE `goods_id`='{$goods_id}'");
@unlink('../' . $original_img);
@unlink('../' . $img);
}
/* 记录上一次选择的分类和品牌 */
setcookie('ECSCP[last_choose]', $catgory_id . '|' . $brand_id, gmtime() + 86400);
/* 清空缓存 */
clear_cache_files();
/* 提示页面 */
$link = array();
if ($code == 'virtual_card') {
$link[] = array('href' => 'virtual_card.php?act=replenish&goods_id=' . $goods_id, 'text' => $_LANG['add_replenish']);
}
if ($is_insert) {
$link[] = add_link($code);
}
$link[] = list_link($is_insert, $code);
sys_msg($is_insert ? $_LANG['add_goods_ok'] : $_LANG['edit_goods_ok'], 0, $link);
} elseif ($_REQUEST['act'] == 'batch') {
$code = empty($_REQUEST['extension_code']) ? '' : trim($_REQUEST['extension_code']);
/* 取得要操作的商品编号 */
$goods_id = !empty($_POST['checkboxes']) ? implode(',', $_POST['checkboxes']) : 0;
if (isset($_POST['type'])) {
/* 放入回收站 */
if ($_POST['type'] == 'trash') {
/* 检查权限 */
admin_priv('remove_back');
update_goods($goods_id, 'is_delete', '1');
/* 记录日志 */
admin_log('', 'batch_trash', 'goods');
示例5: check_admin_referer
case 'move':
check_admin_referer('bulk-bookmarks');
//for each link id (in $linkcheck[]) change category to selected value
if (count($linkcheck) == 0) {
wp_redirect($this_file);
exit;
}
$all_links = join(',', $linkcheck);
// should now have an array of links we can change
//$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
wp_redirect($this_file);
exit;
break;
case 'add':
check_admin_referer('add-bookmark');
add_link();
wp_redirect(wp_get_referer() . '?added=true');
exit;
break;
case 'save':
$link_id = (int) $_POST['link_id'];
check_admin_referer('update-bookmark_' . $link_id);
edit_link($link_id);
wp_redirect($this_file);
exit;
break;
case 'delete':
$link_id = (int) $_GET['link_id'];
check_admin_referer('delete-bookmark_' . $link_id);
wp_delete_link($link_id);
wp_redirect($this_file);
示例6: array
$supplier_list_name = array();
$sql_supplier = "select supplier_id, supplier_name FROM " . $GLOBALS['ecs']->table("supplier") . " where status='1' order by supplier_id ";
$res_supplier = $db->query($sql_supplier);
while ($row_supplier = $db->fetchRow($res_supplier)) {
$supplier_list_name[$row_supplier['supplier_id']] = $row_supplier['supplier_name'];
}
//$suppliers_exists = count($supplier_list_name)>0 ? 1 : 0;
$smarty->assign('suppliers_exists', 1);
//$suppliers_exists);
$smarty->assign('suppliers_list_name', $supplier_list_name);
$supplier_status_list = array('0' => '未审核', '1' => '审核通过', '-1' => '审核未通过');
$smarty->assign('supplier_status_list', $supplier_status_list);
/* 代码增加_end By www.68ecshop.com */
} else {
// 入驻商商品列表不显示添加新商品
$action_link = $_REQUEST['act'] == 'list' ? add_link($code) : array('href' => 'virtual_goods.php?act=list', 'text' => $_LANG['01_goods_list']);
$smarty->assign('action_link', $action_link);
}
/* 模板赋值 */
$goods_ur = array('' => $_LANG['01_goods_list'], 'virtual_card' => $_LANG['50_virtual_card_list']);
$ur_here = $_REQUEST['act'] == 'list' ? $goods_ur[$code] : $_LANG['11_goods_trash'];
$smarty->assign('ur_here', $ur_here);
$smarty->assign('code', $code);
$smarty->assign('cat_list', cat_list(0, $cat_id));
$smarty->assign('brand_list', get_brand_list());
$smarty->assign('intro_list', get_intro_list());
$smarty->assign('lang', $_LANG);
$smarty->assign('list_type', $_REQUEST['act'] == 'list' ? 'goods' : 'trash');
$smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1);
$city = get_city_list();
$smarty->assign('city', $city);
示例7: page_open
<?php
page_open(array("sess" => "Linktrail_Session", "auth" => "Linktrail_Auth", "perm" => "Linktrail_Perm", "user" => "Linktrail_User"));
// page access requires that the user is authenticated and has "admin" permission
$perm->check("admin");
include "dbapi/comutils.inc";
include "dbapi/trails.inc";
include "dbapi/edit_links.inc";
include "template.inc";
$trail = base64_decode($trail);
$trailid = path2id($trail);
$obj['trail'] = $trailid;
$obj['title'] = $title;
$obj['description'] = $description;
$obj['url'] = $url;
$obj['position'] = 0;
$obj['owner'] = $auth->auth["uid"];
add_link($obj, true);
?>
<a href="./trail.php?v=<?php
echo base64_encode($trail);
?>
">Debug: Back</a>
<?php
page_close();
示例8: printc
printc("\n\t\t\t\t\t\t\t\t Copy discussion posts: <input type='checkbox' name='copy_discussions' value='1' checked='checked'/>");
printc("\n\t\t\t\t\t\t\t\t <input type='submit' name='copysite' value='Copy' class='button' />");
}
printc("\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td align='right'>");
if ($_SESSION[amethod] == 'db' || $_SESSION[lmethod] == 'db') {
printc("<a href='passwd.php?{$sid}&action=change' target='password' onclick='doWindow(\"password\",400,300)'>change password</a>");
}
printc("</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>");
printc("\n\t</table>");
printc("\n</form>");
} else {
//add_link(leftnav,"Home","index.php?$sid","","");
//add_link(leftnav,"Personal Site List<br />","index.php?$sid&action=list","","");
add_link(leftnav, "Links");
foreach ($defaultlinks as $t => $u) {
add_link(leftnav, $t, "http://" . $u, '', '', "_blank");
}
// add_link(leftnav,$t." <img src='globe.gif' border='0' align='absmiddle' height='15' width='15' />",$u,'','',"_blank");
printc("\n\t<div class='title'>{$defaulttitle}</div>");
printc("\n\t<div class='leftmargin'>");
printc($defaultmessage);
printc("\n\t</div>");
// if this is the first time they have run Segue, we need to do some first-time
// configuration
if (!user::numDBUsers()) {
require "_first_time_run.inc.php";
}
}
/******************************************************************************
* functions
******************************************************************************/
示例9: show_messages
show_messages($result, 'Element added', 'Cannot add element');
}
add_audit_if($result, AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_MAP, 'Name [' . $sysmap['name'] . '] Element [' . $selementid . '] updated ');
if ($result) {
unset($_REQUEST['form']);
}
}
if (isset($_REQUEST['save_link'])) {
if (isset($_REQUEST['linkid'])) {
// update link
$result = update_link($_REQUEST['linkid'], $_REQUEST['sysmapid'], $_REQUEST['selementid1'], $_REQUEST['selementid2'], get_request('triggers', array()), $_REQUEST['drawtype'], $_REQUEST['color']);
$linkid = $_REQUEST['linkid'];
show_messages($result, 'Link updated', 'Cannot update link');
} else {
// add link
$result = add_link($_REQUEST['sysmapid'], $_REQUEST['selementid1'], $_REQUEST['selementid2'], get_request('triggers', array()), $_REQUEST['drawtype'], $_REQUEST['color']);
$linkid = $result;
show_messages($result, 'Link added', 'Cannot add link');
}
add_audit_if($result, AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_MAP, 'Name [' . $sysmap['name'] . '] Link [' . $linkid . '] updated ');
if ($result) {
unset($_REQUEST['form']);
}
} else {
if (isset($_REQUEST['delete'])) {
if (isset($_REQUEST['linkid'])) {
$result = delete_link($_REQUEST['linkid']);
show_messages($result, 'Link deleted', 'Cannot delete link');
add_audit_if($result, AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_MAP, 'Name [' . $sysmap['name'] . '] Link [' . $_REQUEST['linkid'] . '] deleted');
if ($result) {
unset($_REQUEST['linkid']);
示例10: change_link_direction
function change_link_direction($link_id)
{
check_permission(PERM_DICT);
if (!$link_id) {
throw new UnexpectedValueException();
}
sql_begin();
$revset_id = create_revset();
$res = sql_pe("SELECT * FROM dict_links WHERE link_id=? LIMIT 1", array($link_id));
del_link($link_id, $revset_id);
add_link($res[0]['lemma2_id'], $res[0]['lemma1_id'], $res[0]['link_type'], $revset_id);
sql_commit();
}
示例11: add_link
<li class="expanded">
<a href=<?php
echo add_link($sub_2_item);
?>
title=""><?php
echo $sub_2_item['link']['title'];
?>
</a>
</li>
<ul class="site-map-menu">
<?php
foreach ($sub_2_item['below'] as $sub_3_item) {
?>
<li class="leaf">
<a href=<?php
echo add_link($sub_3_item);
?>
title=""> <?php
echo $sub_3_item['link']['title'];
?>
</a>
</li>
<?php
}
?>
</ul>
<?php
}
}
?>
</ul>
示例12: createPdfName
$link = $o->getField("url");
$target = "_self";
}
$extra = '';
$pdfname = $filename = $fileurl = '';
$pdfname = createPdfName($o->getField("title"));
$filename = "{$uploaddir}/" . $thisSite->name . "/{$pdfname}";
$fileurl = "{$uploadurl}/" . $thisSite->name . "/{$pdfname}";
if (file_exists($filename)) {
$extra .= "<div align='center' class='leftmargin smaller'>" . pdflink($filename, $fileurl, 2) . "</div>";
}
if ($isediting) {
$extra .= $thisSite->hasPermission("edit") ? "\n<a href='{$PHP_SELF}?{$sid}&site={$site}&section={$s}&action=edit_section&edit_section={$s}&comingFrom=viewsite' class='small' title='Edit the title and properties of this section'>edit</a>" : "";
$extra .= $thisSite->hasPermission("delete") ? "\n<a href='javascript:doconfirm(\"Are absolutely sure you want to PERMANENTLY DELETE this section, including anything that may be held within it?? (you better be SURE!)\",\"{$PHP_SELF}?{$sid}&" . $envvars . "&action=delete_section&delete_section={$s}\")' class='small' title='Delete this section'>del</a>" : "";
}
add_link(leftnav2, $o->getField("title"), $link, $extra, $s, $target);
}
$i++;
}
}
}
if ($isediting) {
$leftnav_extra = $thisSite->hasPermission("add") ? " <a href='{$PHP_SELF}?{$sid}&" . $envvars . "&action=add_section&comingFrom=viewsite' class='small' title='Add a new Section to this site. A section can hold one or many pages of content. You can also add a Link here instead of a Section.'>+ add issue</a>" : "";
}
/******************************************************************************
* some functions from the old tko site.
******************************************************************************/
function filesizestr($filename)
{
if (file_exists($filename)) {
$file_size = filesize($filename);
示例13: rssParser
SmartyValidate::connect($tpl);
if (strlen(trim($_REQUEST['rss_url'])) > 0 && !preg_match('#^http[s]?:\\/\\/#i', $_REQUEST['rss_url'])) {
$_REQUEST['rss_url'] = "http://" . $_REQUEST['rss_url'];
}
$tpl->assign('rss_url', $_REQUEST['rss_url']);
if (SmartyValidate::is_valid($_REQUEST)) {
$rss = new rssParser();
$rss_result = $rss->parse($_REQUEST['rss_url']);
if ($rss_result !== true) {
$tpl->assign('error', $rss_result);
}
$tpl->assign('link_count', count($rss->items));
$links = array();
if (count($rss->items) > 0) {
foreach ($rss->items as $item) {
$links[] = add_link($cid, $item['link'], $item['title'], $item['description'], $_POST['status']);
}
$tpl->assign('list', $links);
$tpl->assign('columns', array('TITLE' => _L('Title'), 'URL' => _L('URL'), 'ERROR' => _L('Result')));
}
}
}
$content = $tpl->fetch('dir_links_importrss.tpl');
$tpl->assign('content', $content);
//Clean whitespace
$tpl->loadFilter('output', 'trimwhitespace');
//Make output
echo $tpl->fetch('main.tpl');
// Function to add link data to database
function add_link($cid, $link, $title = 'N/A', $desc = 'N/A', $status = '2')
{
示例14: modifylinkrequest
modifylinkrequest($lid);
break;
case "modifylinkrequests":
modifylinkrequestS($lid, $cat, $_POST['title'], $_POST['url'], $_POST['description'], $_POST['modifysubmitter']);
break;
case "brokenlinks":
brokenlinkS($_POST['lid'], $_POST['cid'], $_POST['title'], $_POST['url'], $_POST['description'], $_POST['modifysubmitter']);
break;
case "visit":
visit($lid);
break;
case 'featured':
featured();
break;
case "add":
add_link($_POST['title'], $_POST['url'], $_POST['auth_name'], $cat, $_POST['description'], $_POST['email']);
break;
case "search":
search(isset($_POST['query']) ? $_POST['query'] : $_GET['query'], isset($_POST['min']) ? intval($_POST['min']) : 0, isset($_GET['orderby']) ? $_GET['orderby'] : '', isset($_POST['show']) ? $_POST['show'] : '');
break;
case "rateinfo":
rateinfo($lid);
break;
case "ratelink":
require "modules/{$module_name}/rate.inc";
ratelink($lid, $_GET['ttitle']);
break;
case "addrating":
require "modules/{$module_name}/rate.inc";
addrating();
break;
示例15: long2ip
?>
" alt="<?php
echo $author;
?>
" />
<span title="IP: <?php
echo long2ip($ip);
?>
"><?php
echo $author;
?>
</span>
</aside>
<section>
<?php
echo indent_text(add_link(nl2br($content)), 4);
?>
</section>
<footer>
<time><?php
echo date('Y-m-d H:i:s', strtotime($datetime . ' UTC'));
?>
</time>
</footer>
</article>
</div>
<div id="modify">
<form action="" method="POST">
<p>
<?php
if (!$admin) {