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


PHP makeLink函数代码示例

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


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

示例1: video

 public function video($page = "video")
 {
     //$this->output->cache(15);
     $uri = $this->uri->segment(2);
     $videoId = getIdFromUri($uri);
     $video = $this->Video_model->getByIdFull($videoId);
     $data = array();
     if ($video) {
         $data['video'] = $video;
         $data['server_type'] = $this->_config['server_type'];
         $seriesId = $video['series_id'];
         $series = $this->Series_model->getByIdFull($seriesId);
         $videosOfSeries = $this->Video_model->getRange("series_id=" . $seriesId, 0, 0, 'episode DESC');
         $randomGenreId = $series['genre'] ? array_rand($series['genre']) : 0;
         $suggestSeriesList = $this->Series_model->listSeriesByGenre($randomGenreId, 0, 8, TRUE, $seriesId);
         $data['videoOfSeries'] = $videosOfSeries;
         //echo "<pre>"; print_r($videosOfSeries); die();
         $data['suggestSeriesList'] = $suggestSeriesList;
         $data['randomGenre'] = $randomGenreId ? array('id' => $randomGenreId, 'name' => $series['genre'][$randomGenreId]) : array();
         $this->layout->title($video['title']);
         $metaData['description'] = getVideoDescription($video);
         $metaData['page_link'] = makeLink($video['id'], $video['title'], 'video');
         $metaData['image'] = getThumbnail($series['thumbnail'], 'series');
         $this->layout->setMeta($metaData);
         $this->layout->view('video/' . $page, $data);
     } else {
         $this->layout->view('home/nodata', array());
     }
 }
开发者ID:pdkhuong,项目名称:VideoFW,代码行数:29,代码来源:Video.php

示例2: toHTML

 function toHTML($label, $name)
 {
     $assets_path = SCRIPT_RELATIVE . 'framework/core/subsystems/forms/controls/assets/';
     $subTypeName = empty($this->subtype) ? "expFile[]" : "expFile[" . $this->subtype . "][]";
     $files = $this->buildImages();
     $html = '<div id="filemanager' . $name . '" class="filemanager control' . (empty($this->class) ? "" : " " . $this->class) . '">';
     //$html .= '<div id="displayfiles" class="displayfiles" style="padding:5px; border:1px solid #444"> </div>';
     $html .= '<div class="hd"><label class="label">' . $label . '';
     if ($this->limit != null) {
         $html .= ' | <small>' . gt('Limit') . ': <em class="limit">' . $this->limit . '</em></small>';
     }
     if ($this->count < $this->limit) {
         $html .= ' | <a class="add" href="#" id="addfiles-' . $name . '">' . gt('Add Files') . '</a>';
     }
     $html .= '</label></div>';
     if (empty($files)) {
         $this->count = 0;
         $files = '<li class="blank">' . gt('You need to add some files') . '</li>';
     }
     $html .= '<ul id="filelist' . $name . '" class="filelist">';
     $html .= $files;
     $html .= '</ul>';
     $html .= '<input type="hidden" name="' . $subTypeName . '" value="' . $subTypeName . '">';
     $html .= '</div>';
     $js = "\n            YUI(EXPONENT.YUI3_CONFIG).use('dd-constrain','dd-proxy','dd-drop','json','io', function(Y) {\n                var limit = " . $this->limit . ";\n                var filesAdded = " . $this->count . ";\n                var fl = Y.one('#filelist" . $name . "');\n                \n                // file picker window opener\n                function openFilePickerWindow(e){\n                    e.halt();\n                    win = window.open('" . makeLink($params = array('controller' => 'file', 'action' => 'picker', 'ajax_action' => "1", 'update' => $name)) . "', 'IMAGE_BROWSER','left=20,top=20,scrollbars=yes,width=800,height=600,toolbar=no,resizable=yes,status=0');\n                    if (!win) {\n                        //Catch the popup blocker\n                        alert('" . gt('Please disable your popup blocker') . "!!');\n                    }\n                };\n                \n                var listenForAdder = function(){\n                    var af = Y.one('#addfiles-" . $name . "');\n                    af.on('click',openFilePickerWindow);\n                };\n                \n                var showEmptyLI = function(){\n                    var blank = Y.Node.create('<li class=\"blank\">" . gt('You need to add some files') . "</li>');\n                    fl.appendChild(blank);\n                };\n                \n                if (limit > filesAdded) {\n                    listenForAdder();\n                }\n                                \n                // remove the file from the list\n                fl.delegate('click',function(e){\n                    e.target.ancestor('li').remove();\n                    \n                    showFileAdder();\n                },'.delete');\n                \n                var showFileAdder = function() {\n                    var sf = Y.one('#addfiles-" . $name . "');\n                    if (Y.Lang.isNull(sf)) {\n                        var afl = Y.Node.create('<a class=\"add\" href=\"#\" id=\"addfiles-" . $name . "\">" . gt('Add Files') . "</a>');\n                        Y.one('#filemanager" . $name . " .hd').append(afl);\n                        listenForAdder();\n                    }\n                    filesAdded--;\n                    if (filesAdded == 0) showEmptyLI();\n                }\n\n                //Drag Drop stuff\n                \n                //Listen for all drop:over events\n                Y.DD.DDM.on('drop:over', function(e) {\n                    //Get a reference to out drag and drop nodes\n                    var drag = e.drag.get('node'),\n                        drop = e.drop.get('node');\n\n                    //Are we dropping on a li node?\n                    if (drop.get('tagName').toLowerCase() === 'li') {\n                        //Are we not going up?\n                        if (!goingUp) {\n                            drop = drop.get('nextSibling');\n                        }\n                        //Add the node to this list\n                        e.drop.get('node').get('parentNode').insertBefore(drag, drop);\n                        //Resize this nodes shim, so we can drop on it later.\n                        e.drop.sizeShim();\n                    }\n                });\n                //Listen for all drag:drag events\n                Y.DD.DDM.on('drag:drag', function(e) {\n                    //Get the last y point\n                    var y = e.target.lastXY[1];\n                    //is it greater than the lastY var?\n                    if (y < lastY) {\n                        //We are going up\n                        goingUp = true;\n                    } else {\n                        //We are going down..\n                        goingUp = false;\n                    }\n                    //Cache for next check\n                    lastY = y;\n                });\n                //Listen for all drag:start events\n                Y.DD.DDM.on('drag:start', function(e) {\n                    //Get our drag object\n                    var drag = e.target;\n                    //Set some styles here\n                    drag.get('node').setStyle('opacity', '.25');\n                    drag.get('dragNode').set('innerHTML', drag.get('node').get('innerHTML'));\n                    drag.get('dragNode').setStyles({\n                        opacity: '.85',\n                        borderColor: drag.get('node').getStyle('borderColor'),\n                        backgroundImage: drag.get('node').getStyle('backgroundImage')\n                    });\n                });\n                //Listen for a drag:end events\n                Y.DD.DDM.on('drag:end', function(e) {\n                    var drag = e.target;\n                    //Put out styles back\n                    drag.get('node').setStyles({\n                        visibility: '',\n                        opacity: '1'\n                    });\n                });\n                //Listen for all drag:drophit events\n                Y.DD.DDM.on('drag:drophit', function(e) {\n                    var drop = e.drop.get('node'),\n                        drag = e.drag.get('node');\n\n                    //if we are not on an li, we must have been dropped on a ul\n                    if (drop.get('tagName').toLowerCase() !== 'li') {\n                        if (!drop.contains(drag)) {\n                            drop.appendChild(drag);\n                        }\n                    }\n                });\n\n                //Static Vars\n                var goingUp = false, lastY = 0;\n\n                var initDragables =  function(){\n\n                    //Get the list of li's in the lists and make them draggable\n                    var lis = Y.Node.all('#filelist" . $name . " li');\n                    if (lis){\n                        lis.each(function(v, k) {\n                            var dd = new Y.DD.Drag({\n                                node: v,\n                                proxy: true,\n                                moveOnEnd: false,\n                                target: {\n                                    padding: '0 0 0 20'\n                                }\n                            }).plug(Y.Plugin.DDConstrained, {\n                                //Keep it inside the #list1 node\n                                constrain2node: '#filelist" . $name . "',\n                                stickY:true\n                            }).plug(Y.Plugin.DDProxy, {\n                                //Don't move the node at the end of the drag\n                                moveOnEnd: false,\n                                borderStyle:'0'\n                            });//.addHandle('.fpdrag');\n                        });\n                    }\n\n                    //var tar = new Y.DD.Drop({ node:Y.one('#filelist" . $name . "')});\n                }\n                \n                initDragables();\n\n                // calback function from open window\n                EXPONENT.passBackFile" . $name . " = function(id) {\n\n                    var complete = function (ioId, o) {\n                        var df = Y.one('#filelist" . $name . "');\n                        var objson = Y.JSON.parse(o.responseText);\n                        var obj = objson.data;\n                        if (obj.mimetype!='image/png' && obj.mimetype!='image/gif' && obj.mimetype!='image/jpeg'){\n                            var filepic = '<img class=\"filepic\" src=\"'+EXPONENT.ICON_RELATIVE+'\"attachableitems/generic_22x22.png\">';\n                        } else {\n                            var filepic = '<img class=\"filepic\" src=\"'+EXPONENT.URL_FULL+'thumb.php?id='+obj.id+'&amp;w=24&amp;h=24&amp;zc=1\">';\n                        }\n                    \n                        var html = '<li>';\n                        html += '<input type=\"hidden\" name=\"" . $subTypeName . "\" value=\"'+obj.id+'\">';\n                        html += '<a class=\"delete\" rel=\"imgdiv'+obj.id+'\" href=\"javascript:{}\">" . gt('delete') . "<\\/a>';\n                        html += filepic;\n                        html += '<span class=\"filename\">'+obj.filename+'<\\/span>';\n                        html += '<\\/li>';\n                        \n                        htmln = Y.Node.create(html);                        \n                        \n                        df.append(htmln);\n\n                        var dd = new Y.DD.Drag({\n                            node: htmln,\n                            proxy: true,\n                            moveOnEnd: false,\n                            target: {\n                                padding: '0 0 0 20'\n                            }\n                        }).plug(Y.Plugin.DDConstrained, {\n                            constrain2node: '#filelist" . $name . "',\n                            stickY:true\n                        }).plug(Y.Plugin.DDProxy, {\n                            moveOnEnd: false,\n                            borderStyle:'0'\n                        });\n\n                        \n                        var af = Y.one('#addfiles-" . $name . "');\n\n                        if (filesAdded==0) {\n                            fl.one('.blank').remove();\n                        }\n\n                        filesAdded++\n\n                        if (!Y.Lang.isNull(af) && limit==filesAdded) {\n                            af.remove();\n                        }\n\n                        //initDragables();\n                    };\n                    \n                    var cfg = {\n                        on:{\n                            success:complete\n                        }\n                    };\n                    Y.io(EXPONENT.URL_FULL+'index.php.php?controller=file&action=getFile&ajax_action=1&json=1&id='+id, cfg);\n                    //ej.fetch({action:'getFile',controller:'fileController',json:1,params:'&id='+id});\n                }\n\n            });\n            ";
     // END PHP STRING LITERAL
     expCSS::pushToHead(array("unique" => "cal2", "link" => $assets_path . "files/attachable-files.css"));
     //        exponent_javascript_toFoot("filepicker".$name,"json,connection","dd-constrain,dd-proxy,dd-drop",$js,"");
     expJavascript::pushToFoot(array("unique" => "filepicker" . $name, "yui3mods" => "1", "content" => $js, "src" => ""));
     return $html;
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:31,代码来源:filemanagercontrol.php

示例3: smarty_function_backlink

/**
 * Smarty {backlink} function plugin
 *
 * Type:     function<br>
 * Name:     backlink<br>
 * Purpose:  create a back link
 *
 * @param         $params
 * @param \Smarty $smarty
 */
function smarty_function_backlink($params, &$smarty)
{
    //	global $history;
    //	$d=$params['distance']?$params['distance']+1:2;
    //	echo makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-$d]['params']);
    $d = $params['distance'] ? $params['distance'] : 1;
    echo makeLink(expHistory::getBack($d));
}
开发者ID:notzen,项目名称:exponent-cms,代码行数:18,代码来源:function.backlink.php

示例4: init

 function init()
 {
     global $language, $config, $messages;
     $this->esoTalk->view = "feed.view.php";
     header("Content-type: text/xml; charset={$language["charset"]}");
     // Work out what type of feed we're doing:
     // conversation/[id] -> fetch the posts in conversation [id]
     // default -> fetch the most recent posts over the whole forum
     switch (@$_GET["q2"]) {
         case "conversation":
             // Get the conversation.
             $conversationId = (int) $_GET["q3"];
             if (!$conversationId or !($conversation = $this->esoTalk->db->fetchAssoc("SELECT c.conversationId AS id, c.title AS title, c.slug AS slug, c.private AS private, c.posts AS posts, c.startMember AS startMember, c.lastActionTime AS lastActionTime, GROUP_CONCAT(t.tag ORDER BY t.tag ASC SEPARATOR ', ') AS tags FROM {$config["tablePrefix"]}conversations c LEFT JOIN {$config["tablePrefix"]}tags t USING (conversationId) WHERE c.conversationId={$conversationId} GROUP BY c.conversationId"))) {
                 $this->esoTalk->fatalError($messages["cannotViewConversation"]["message"]);
             }
             // Do we need authentication?
             if ($conversation["private"] or $conversation["posts"] == 0) {
                 // Try to login with provided credentials.
                 if (isset($_SERVER["PHP_AUTH_USER"])) {
                     $this->esoTalk->login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]);
                 }
                 // Still not logged in? Ask them again!
                 if (!$this->esoTalk->user) {
                     header('WWW-Authenticate: Basic realm="esoTalk RSS feed"');
                     header('HTTP/1.0 401 Unauthorized');
                     $this->esoTalk->fatalError($messages["cannotViewConversation"]["message"]);
                 }
                 // We're logged in now. So, is this member allowed in this conversation?
                 if (!($conversation["startMember"] == $this->esoTalk->user["memberId"] or $conversation["posts"] > 0 and (!$conversation["private"] or $this->esoTalk->db->result("SELECT allowed FROM {$config["tablePrefix"]}status WHERE conversationId={$conversationId} AND (memberId={$this->esoTalk->user["memberId"]} OR memberId='{$this->esoTalk->user["account"]}')", 0)))) {
                     // Nuh-uh. Get OUT!!!
                     $this->esoTalk->fatalError($messages["cannotViewConversation"]["message"]);
                 }
             }
             // Past this point, the user is allowed to view the conversation.
             // Set the title, link, description, etc.
             $this->title = "{$conversation["title"]} - {$config["forumTitle"]}";
             $this->link = $config["baseURL"] . makeLink($conversation["id"], $conversation["slug"]);
             $this->description = $conversation["tags"];
             $this->pubDate = date("D, d M Y H:i:s O", $conversation["lastActionTime"]);
             // Get posts
             $result = $this->esoTalk->db->query("SELECT postId, name, content, time FROM {$config["tablePrefix"]}posts INNER JOIN {$config["tablePrefix"]}members USING (memberId) WHERE conversationId={$conversation["id"]} AND p.deleteMember IS NULL ORDER BY time DESC LIMIT 20");
             while (list($id, $member, $content, $time) = $this->esoTalk->db->fetchRow($result)) {
                 $this->items[] = array("title" => $member, "description" => sanitize($this->absoluteURLs($content)), "link" => $config["baseURL"] . makeLink("post", $id), "date" => date("D, d M Y H:i:s O", $time));
             }
             break;
         default:
             // It doesn't matter whether we're logged in or not - just get the posts!
             $result = $this->esoTalk->db->query("SELECT p.postId, c.title, m.name, p.content, p.time FROM {$config["tablePrefix"]}posts p LEFT JOIN {$config["tablePrefix"]}conversations c USING (conversationId) INNER JOIN {$config["tablePrefix"]}members m ON (m.memberId=p.memberId) WHERE c.private=0 AND c.posts>0 AND p.deleteMember IS NULL ORDER BY p.time DESC LIMIT 20");
             while (list($postId, $title, $member, $content, $time) = $this->esoTalk->db->fetchRow($result)) {
                 $this->items[] = array("title" => "{$member} - {$title}", "description" => sanitize($this->absoluteURLs($content)), "link" => $config["baseURL"] . makeLink("post", $postId), "date" => date("D, d M Y H:i:s O", $time));
             }
             // Set the title, link, description, etc.
             $this->title = "{$language["Recent posts"]} - {$config["forumTitle"]}";
             $this->link = $config["baseURL"];
             $this->pubDate = !empty($this->items[0]) ? $this->items[0]["date"] : "";
     }
 }
开发者ID:bk-amahi,项目名称:esoTalk,代码行数:57,代码来源:feed.controller.php

示例5: tile_TheTileName

function tile_TheTileName($group, $x, $y, $width, $height, $background, $url, $labelText, $labelColor, $labelPosition, $classes)
{
    global $scale, $spacing, $scaleSpacing, $groupSpacing;
    $marginTop = $y * $scaleSpacing + getMarginTop($group);
    $marginLeft = $x * $scaleSpacing + getMarginLeft($group);
    $tileWidth = $width * $scaleSpacing - $spacing;
    $tileHeight = $height * $scaleSpacing - $spacing;
    ?>
  	<a <?php 
    echo makeLink($url);
    ?>
 class="tile group<?php 
    echo $group;
    ?>
 <?php 
    echo $classes;
    ?>
" style="
    margin-top:<?php 
    echo $marginTop;
    ?>
px; margin-left:<?php 
    echo $marginLeft;
    ?>
px;
	width:<?php 
    echo $tileWidth;
    ?>
px; height:<?php 
    echo $tileHeight;
    ?>
px;
	background:<?php 
    echo $background;
    ?>
;" <?php 
    posVal($marginTop, $marginLeft, $tileWidth);
    ?>
> 
    
    
    
    <?php 
    if ($labelText != "") {
        if ($labelPosition == 'top') {
            echo "<div class='tileLabelWrapper top' style='border-top-color:" . $labelColor . ";'><div class='tileLabel top' >" . $labelText . "</div></div>";
        } else {
            echo "<div class='tileLabelWrapper bottom'><div class='tileLabel bottom' style='border-bottom-color:" . $labelColor . ";'>" . $labelText . "</div></div>";
        }
    }
    ?>
 
    </a>
    <?php 
}
开发者ID:s1kartik,项目名称:s1,代码行数:55,代码来源:plugin.php

示例6: init

 function init()
 {
     if ($this->esoTalk->user) {
         redirect("");
     }
     global $language, $messages, $config;
     $this->title = $language["Forgot your password"];
     $this->esoTalk->addToHead("<meta name='robots' content='noindex, noarchive'/>");
     // If we're on the second step (they've clicked the link in their email)
     if ($hash = @$_GET["q2"]) {
         // Get the user with this recover password hash
         $result = $this->esoTalk->db->query("SELECT memberId FROM {$config["tablePrefix"]}members WHERE resetPassword='{$hash}'");
         if (!$this->esoTalk->db->numRows($result)) {
             redirect("forgotPassword");
         }
         list($memberId) = $this->esoTalk->db->fetchRow($result);
         $this->setPassword = true;
         // Validate the form if it was submitted
         if (isset($_POST["changePassword"])) {
             $password = @$_POST["password"];
             $confirm = @$_POST["confirm"];
             if ($error = validatePassword(@$_POST["password"])) {
                 $this->errors["password"] = $error;
             }
             if ($password != $confirm) {
                 $this->errors["confirm"] = "passwordsDontMatch";
             }
             if (!count($this->errors)) {
                 $passwordHash = md5($config["salt"] . $password);
                 $this->esoTalk->db->query("UPDATE {$config["tablePrefix"]}members SET resetPassword=NULL, password='{$passwordHash}' WHERE memberId={$memberId}");
                 $this->esoTalk->message("passwordChanged", false);
                 redirect("");
             }
         }
     }
     // If they've submitted their email for a password link, email them!
     if (isset($_POST["email"])) {
         // Find the member with this email
         $result = $this->esoTalk->db->query("SELECT memberId, name, email FROM {$config["tablePrefix"]}members WHERE email='{$_POST["email"]}'");
         if (!$this->esoTalk->db->numRows($result)) {
             $this->esoTalk->message("emailDoesntExist");
             return;
         }
         list($memberId, $name, $email) = $this->esoTalk->db->fetchRow($result);
         // Set a special 'forgot password' hash
         $hash = md5(rand());
         $this->esoTalk->db->query("UPDATE {$config["tablePrefix"]}members SET resetPassword='{$hash}' WHERE memberId={$memberId}");
         // Send the email
         if (sendEmail($email, sprintf($language["emails"]["forgotPassword"]["subject"], $name), sprintf($language["emails"]["forgotPassword"]["body"], $name, $config["forumTitle"], $config["baseURL"] . makeLink("forgot-password", $hash)))) {
             $this->esoTalk->message("passwordEmailSent", false);
             redirect("");
         }
     }
 }
开发者ID:bk-amahi,项目名称:esoTalk,代码行数:54,代码来源:forgot-password.controller.php

示例7: index

 public function index($page = "index")
 {
     //$this->output->cache(15);
     $data = array();
     if (isset($_GET['keyword']) && strlen($_GET['keyword']) > 2) {
         $keyword = filterText($_GET['keyword']);
         $data['original_keyword'] = $keyword;
         $keyword = strtolower($keyword);
         $keyword = str_replace(' ep ', ' episode ', $keyword);
         $whereClause = "title LIKE '%" . $keyword . "%'";
         $pageNum = isset($_GET['p']) ? intval($_GET['p']) : 1;
         $offset = ($pageNum - 1) * ITEM_PER_PAGE;
         $total = $this->Series_model->getTotal($whereClause);
         $listObject = $this->Series_model->getRange($whereClause, $offset, ITEM_PER_PAGE);
         $data['keyword'] = $keyword;
         $data['max'] = ITEM_PER_PAGE;
         $data['offset'] = $offset;
         $data['total'] = $total;
         $this->layout->title('Search result for ' . $keyword);
         $metaData['page_link'] = makeLink(0, $keyword, 'search');
         $this->layout->setMeta($metaData);
         if (empty($listObject)) {
             $whereClause2 = "video.title LIKE '%" . $keyword . "%'";
             $total = $this->Video_model->getTotalFull($whereClause2);
             $data['total'] = $total;
             $listVideo = $this->Video_model->getRangeFull($whereClause2, $offset, ITEM_PER_PAGE);
             if ($listVideo) {
                 $data['listObject'] = $listVideo;
                 $this->layout->view('search/video', $data);
             } else {
                 $this->layout->view('home/nodata', array());
             }
         } else {
             $data['listObject'] = $listObject;
             $this->layout->view('search/' . $page, $data);
         }
     } else {
         redirect('');
     }
 }
开发者ID:pdkhuong,项目名称:VideoFW,代码行数:40,代码来源:Search.php

示例8: makeLink

"><?php 
        echo $info['title'];
        ?>
</a> >
<?php 
    } else {
        ?>
 > <a href="<?php 
        echo makeLink($c, 'list', array('classid' => $info['classid'], 'filename' => $classinfo['filename']));
        ?>
"><?php 
        echo $classinfo['title'];
        ?>
</a>
 > <a href="<?php 
        echo makeLink($c, $a, array('id' => $info['id'], 'filename' => $info['filename']));
        ?>
"><?php 
        echo $info['title'];
        ?>
</a> >
<?php 
    }
}
?>

<?php 
if ($a == 'search') {
    ?>
 > 搜索
<?php 
开发者ID:zrwlc2008,项目名称:abhx,代码行数:31,代码来源:ur_here.lib.php

示例9: preprocess

 /**
  * the first thing after checkout.
  * 
  */
 public function preprocess()
 {
     //eDebug($this->params,true);
     global $order, $user, $db;
     //eDebug($_POST, true);
     // get the shippnig and billing objects, these objects handle the setting up the billing/shipping methods
     // and their calculators
     $shipping = new shipping();
     $billing = new billing();
     // since we're skipping the billing method selection, do it here
     $billing->billingmethod->update($this->params);
     //this is just dumb. it doesn't update the object, refresh doesn't work, and I'm tired
     $billing = new billing();
     if (!$user->isLoggedIn()) {
         flash('message', gt("It appears that your session has expired. Please log in to continue the checkout process."));
         expHistory::redirecto_login(makeLink(array('module' => 'cart', 'action' => 'checkout'), 'secure'));
     }
     // Make sure all the pertanent data is there...otherwise flash an error and redirect to the checkout form.
     if (empty($order->orderitem)) {
         flash('error', gt('There are no items in your cart.'));
     }
     if (empty($shipping->calculator->id) && !$shipping->splitshipping) {
         flash('error', gt('You must pick a shipping method'));
     }
     if (empty($shipping->address->id) && !$shipping->splitshipping) {
         flash('error', gt('You must pick a shipping address'));
     }
     if (empty($billing->calculator->id)) {
         flash('error', gt('You must pick a billing method'));
     }
     if (empty($billing->address->id)) {
         flash('error', gt('You must select a billing address'));
     }
     // make sure all the methods picked for shipping meet the requirements
     foreach ($order->getShippingMethods() as $smid) {
         $sm = new shippingmethod($smid);
         $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id=' . $sm->shippingcalculator_id);
         $calc = new $calcname($sm->shippingcalculator_id);
         $ret = $calc->meetsCriteria($sm);
         if (is_string($ret)) {
             flash('error', $ret);
         }
     }
     // if we encounterd any errors we will return to the checkout page and show the errors
     if (!expQueue::isQueueEmpty('error')) {
         redirect_to(array('controller' => 'cart', 'action' => 'checkout'));
     }
     // get the billing options..this is usually the credit card info entered by the user
     $opts = $billing->calculator->userFormUpdate($this->params);
     //$billing->calculator->preprocess($this->params);
     //eDebug($opts);
     expSession::set('billing_options', $opts);
     //$o = expSession::get('billing_options');
     //eDebug($o,true);
     //eDebug($this->params,true);
     //this should probably be genericized a bit more - currently assuming order_type parameter is present, or defaults
     //eDebug($order->getDefaultOrderType(),true);
     $order->setOrderType($this->params);
     $order->setOrderStatus($this->params);
     //eDebug($order,true);
     // final the cart totals
     $order->calculateGrandTotal();
     //eDebug($order,true);
     // call the billing mehod's preprocess in case it needs to prepare things.
     // eDebug($billing);
     $result = $billing->calculator->preprocess($billing->billingmethod, $opts, $this->params, $order);
     // once in a while it appears the payment processor will return a nullo value in the errorCode field
     // which the previous check takes as a TRUE, as 0, null, and empty will all equate out the same using the ==
     // adding the === will specifically test for a 0 and only a 0, which is what we want
     if (empty($result->errorCode)) {
         redirect_to(array('controller' => 'cart', 'action' => 'confirm'));
     } else {
         flash('error', gt('An error was encountered while processing your transaction.') . '<br /><br />' . $result->message);
         expHistory::back();
     }
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:80,代码来源:cartController.php

示例10: makeLink

	  <a href="./<?php 
        echo makeLink('downloads', 'show', array('id' => $value['id'], 'filename' => $value['filename']));
        ?>
" title="<?php 
        echo $value['title'];
        ?>
"><img height="60" width="80" src="<?php 
        echo $value['thumb'];
        ?>
" /></a>
	  </div>
	  </div>
	  <div class="icl_list_right">
	  <div class="icl_list_right_title">
	  <a href="./<?php 
        echo makeLink('downloads', 'show', array('id' => $value['id'], 'filename' => $value['filename']));
        ?>
" title="<?php 
        echo $value['title'];
        ?>
"><font color="<?php 
        echo $value['titlecolor'];
        ?>
"><?php 
        echo cutstr($value['title'], 16);
        ?>
</font></a>
	  </div>
	  <div class="icl_list_right_intro">
	  <?php 
        echo cutstr($value['intro'], 40);
开发者ID:zrwlc2008,项目名称:abhx,代码行数:31,代码来源:icld_2_list.lib.php

示例11: makeLink

<?php 
} else {
    echo $this->esoTalk->htmlMessage("noSkinsInstalled");
}
?>

<fieldset id='addSkin'>
<legend><?php 
echo $language["Add a new skin"];
?>
</legend>
<?php 
echo $this->esoTalk->htmlMessage("downloadSkins", "http://esotalk.com/skins");
?>
<form action='<?php 
echo makeLink("skins");
?>
' method='post' enctype='multipart/form-data'>
<ul class='form'>
<li><label><?php 
echo $language["Upload a skin"];
?>
</label> <input name='uploadSkin' type='file' class='text' size='20'/></li>
<li><label></label> <?php 
echo $this->esoTalk->skin->button(array("value" => $language["Add skin"]));
?>
</li>
</ul>
</form>
</fieldset>
开发者ID:bk-amahi,项目名称:esoTalk,代码行数:30,代码来源:skins.view.php

示例12: readtxt

function readtxt($f)
{
    $return = '';
    $filename = $f;
    $ini_handle = fopen($filename, "r");
    $return = fread($ini_handle, filesize($filename));
    $return = nl2br($return);
    return makeLink($return);
}
开发者ID:hevelmo,项目名称:templates,代码行数:9,代码来源:index.php

示例13: define

 // 40,000 almost definitely will not exceed the 10MB sitemap limit.
 define("ZLIB", extension_loaded("zlib") ? ".gz" : null);
 // Generate conversation sitemap files until we run out of conversations.
 while (true) {
     // Set the filename with the counter.
     $filename = "sitemap.conversations.{$i}.xml" . ZLIB;
     // Get the next batch of public conversations from the database.
     $r = mysql_query("SELECT conversationId, slug, posts / ((UNIX_TIMESTAMP() - startTime) / 86400) AS postsPerDay, IF(lastActionTime, lastActionTime, startTime) AS lastUpdated, posts FROM " . config("esoTalk.database.prefix") . "conversations WHERE !private LIMIT " . ($i - 1) * URLS_PER_SITEMAP . "," . URLS_PER_SITEMAP);
     // If there are no conversations left, break from the loop.
     if (!mysql_num_rows($r)) {
         break;
     } else {
         $urlset = "<?xml version='1.0' encoding='UTF-8'?><urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>";
         // Create a <url> tag for each conversation in the result set.
         while (list($conversationId, $slug, $postsPerDay, $lastUpdated, $posts) = mysql_fetch_row($r)) {
             $urlset .= "<url><loc>{$config["baseURL"]}" . makeLink($conversationId, $slug) . "</loc><lastmod>" . gmdate("Y-m-d\\TH:i:s+00:00", $lastUpdated) . "</lastmod><changefreq>";
             // How often should we tell them to check for updates?
             if ($postsPerDay < 0.006) {
                 $urlset .= "yearly";
             } elseif ($postsPerDay < 0.07000000000000001) {
                 $urlset .= "monthly";
             } elseif ($postsPerDay < 0.3) {
                 $urlset .= "weekly";
             } elseif ($postsPerDay < 3) {
                 $urlset .= "daily";
             } else {
                 $urlset .= "hourly";
             }
             $urlset .= "</changefreq>";
             // Estimate the conversation's importance based upon the number of posts.
             if ($posts < 50) {
开发者ID:ky0ncheng,项目名称:esotalk-for-sae,代码行数:31,代码来源:ETSitemapController.class.php

示例14: makeLink

    ?>
 &amp; <?php 
    echo $this->esoTalk->user["name"];
    ?>
<br/><span class='label private'><?php 
    echo $language["labels"]["private"];
    ?>
</span></label> <div><a href='<?php 
    echo makeLink("search", "?q2=private+%2B+contributor:" . urlencode(desanitize($this->member["name"])));
    ?>
'><?php 
    printf($language["See the private conversations I've had"], $this->member["name"]);
    ?>
</a><br/>
<a href='<?php 
    echo makeLink("new", "?member=" . urlencode(desanitize($this->member["name"])));
    ?>
'><?php 
    printf($language["Start a private conversation"], $this->member["name"]);
    ?>
</a></div></li>
<?php 
}
?>

</ul>
</div>
</div>

<?php 
ksort($this->sections);
开发者ID:bk-amahi,项目名称:esoTalk,代码行数:31,代码来源:profile.view.php

示例15: addContentToSearch

 /**
  * add all module items to search index
  * @return int
  */
 function addContentToSearch()
 {
     global $db, $router;
     $count = 0;
     $model = new $this->basemodel_name(null, false, false);
     $content = $db->selectArrays($model->tablename);
     foreach ($content as $cnt) {
         $origid = $cnt['id'];
         unset($cnt['id']);
         // get the location data for this content
         if (isset($cnt['location_data'])) {
             $loc = expUnserialize($cnt['location_data']);
         }
         $src = isset($loc->src) ? $loc->src : null;
         //build the search record and save it.
         $search_record = new search($cnt, false, false);
         $search_record->original_id = $origid;
         $search_record->posted = empty($cnt['created_at']) ? null : $cnt['created_at'];
         $link = str_replace(URL_FULL, '', makeLink(array('controller' => $this->baseclassname, 'action' => 'show', 'id' => $origid, 'src' => $src)));
         //	        if (empty($search_record->title)) $search_record->title = 'Untitled';
         $search_record->view_link = $link;
         $search_record->ref_module = $this->classname;
         $search_record->category = $this->searchName();
         $search_record->ref_type = $this->searchCategory();
         $search_record->save();
         $count += 1;
     }
     return $count;
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:33,代码来源:expController.php


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