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


PHP rurl函数代码示例

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


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

示例1: actionLove

 public function actionLove()
 {
     $record = ManyCategoryUser::model()->deleteAll(array('user_id' => User()->id));
     $nodes = $_POST['nodes'];
     foreach ($nodes as $node) {
         $rel = new ManyCategoryUser();
         $rel->category_id = $node;
         $rel->user_id = User()->id;
         $rel->save();
     }
     $this->redirect(rurl());
 }
开发者ID:paranoidxc,项目名称:iwebhost,代码行数:12,代码来源:FController.php

示例2: rurl

<ul>
<?php 
$u = rurl();
$menu_items = array(array($u, 'HOME'), array($u . '/about.php', 'ETHICS'), array($u . '/members.php', 'MEMBERS'), array($u . '/gallery/', 'GALLERY'), array($u . '/contact.php', 'CONTACT'));
if (!empty($arrUser) && $arrUser['type'] == 'admin') {
    array_push($menu_items, array($u . '/admin', 'ADMIN'));
}
if (!empty($arrUser) && $arrUser['idEditor'] == $arrUser['idUser']) {
    array_push($menu_items, array($u . '/edit', 'MyPOSTS'));
}
$I_am_at = explode('?', "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
foreach ($menu_items as $item) {
    if ($I_am_at[0] == $item[0] || $I_am_at[0] == $item[0] . '/') {
        echo "<li class=\"select\"><a href=\"{$item['0']}\">{$item['1']}</a></li>";
    } else {
        echo "<li><a href=\"{$item['0']}\">{$item['1']}</a></li>";
    }
}
?>

</ul>
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:21,代码来源:menu.inc.php

示例3: rurl

<ul>
<?php 
$u = rurl() . '/admin/';
$menu_items = array(array($u, 'ADMIN ZONE'), array($u . 'post-manager.php', 'POSTS'), array($u . 'user-manager.php', 'USERS'), array(rurl(), '&nbsp;&rarr;HOME'));
$I_am_at = explode('?', "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
foreach ($menu_items as $item) {
    if ($I_am_at[0] == $item[0] || $I_am_at[0] == $item[0] . '/') {
        echo "<li class=\"select\"><a href=\"{$item['0']}\">{$item['1']}</a></li>";
    } else {
        echo "<li><a href=\"{$item['0']}\">{$item['1']}</a></li>";
    }
}
?>
</ul>
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:14,代码来源:menu.inc.php

示例4: populate_db_manual

function populate_db_manual($db, $sqlfile = 'administrator/backups/database-sql.sql')
{
    global $qstr, $_CONFIG;
    $extra_que = $qstr[0];
    $file = $sqlfile;
    define('DATA_CHUNK_LENGTH', 16384);
    // How many chars are read per time
    define('MAX_QUERY_LINES', 300);
    // How many lines may be considered to be one query (except text lines)
    $lines = "";
    $error = "";
    $error_status = 0;
    if (isset($_REQUEST['chunk']) && (int) $_REQUEST['chunk'] != 0) {
        $chunk = $_REQUEST['chunk'];
    } else {
        $chunk = DATA_CHUNK_LENGTH;
    }
    if ($_REQUEST['correct_query'] != 1) {
        $start_pos = (int) $_REQUEST['fpos'];
        $fpos = read_file($file, MAX_QUERY_LINES, $start_pos, $chunk, $lines);
    } else {
        $lines[0] = stripslashes($_REQUEST['error_msg']);
        $fpos = $_REQUEST['start_posf'];
    }
    foreach ($lines as $line) {
        if (trim($line) != '') {
            $query = $line;
            $line = $line . ";\n";
            #$tmp = explode("DEFAULT CHARSET",$line);
            $line_tmp = $line;
            $start_pos = $start_pos + strlen($line);
            if (isset($_REQUEST['strrep'])) {
                $strrep = explode("\r\n", stripslashes($_REQUEST['strrep']));
                foreach ($strrep as $value) {
                    if (trim($value) != "") {
                        $tmp = explode("|", $value);
                        $line_tmp = str_replace(trim($tmp[0]), trim($tmp[1]), $line_tmp);
                        $query = str_replace(trim($tmp[0]), trim($tmp[1]), $query);
                    }
                }
            }
            if (!$_CONFIG['mysqli']->query($line_tmp)) {
                if ($_REQUEST['correct_query'] != 1) {
                    $fpos = $start_pos;
                }
                $form_url = rurl($fpos, $chunk);
                echo "</form><form name='' action='" . $form_url . "' method='POST'>\r\n\r\n\t   <input type='hidden' name='correct_query' value = '1'>\r\n\r\n\t   <input type='hidden' name='start_pos' value='" . ($start_pos - strlen($line)) . "'>\r\n\r\n\t   <input type='hidden' name='start_posf' value='" . $fpos . "'>\r\n\r\n\t   <input type='hidden' name='glen' value='" . $qlen . "'>\r\n\r\n\t   <center>";
                echo sprintf("<b>###MYSQL error</b>\n<br /><font color='red'>" . $_CONFIG['mysqli']->error . "</font><br />\n<b>###On Query:</b><br />\n<br /><textarea cols=70 rows=15 name='error_msg'>%s</textarea><br />", $query);
                echo "<b>Search and replace in query:</b><br /><textarea cols=70 rows=5 name='strrep'>" . stripslashes($_REQUEST[strrep]) . "</textarea><br />\r\n\r\n\t   <small>\r\n\r\n\t   enter a string, one per line, which you would like to replace in the query above, example <i>string_to_search|text_to_replace_with</i>\r\n\r\n\t   </small>";
                echo "<br /> <input type=submit name=submit value='Correct Query &gt;&gt;'>";
                echo "</center></form>";
                $error_status = 1;
                break;
            }
        }
    }
    $percent = sprintf("%.2f", 100 * $fpos / filesize($file));
    if ($fpos != '-1') {
        echo "<h3>Processed {$percent}% from sql backup!</h3>";
        $red_url = rurl($fpos, $chunk);
        if ($error_status == 1) {
            echo "<h3><a href='" . $red_url . "'>To skip this query, click here to Continue</a></h3>";
            exit;
        } else {
            echo "<h3><a href='" . $red_url . "'>Continue here</a></h3>";
            echo "<script>window.location='" . $red_url . "'</script>";
            exit;
        }
    } else {
        echo "<h3>The sql import is finished!</h3>";
    }
    return;
}
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:73,代码来源:XCloner.php

示例5: rurl

    }
    // VIEW GALLERY
    if (!empty($m_picasaUser)) {
        ?>
							<div class="msg" style="clear: right;">
								<a href="<?php 
        echo rurl();
        ?>
/gallery/<?php 
        echo $m_idUser . '/' . $m_username;
        ?>
" title="<?php 
        echo "{$m_usernames} gallery";
        ?>
">pictures <img class="msg" src="<?php 
        echo rurl() . '/images/gallery.png';
        ?>
"/>
								</a>
							</div>
							<?php 
    }
    ?>
							
							<h2><?php 
    echo '<a href="' . $m_info_url . '" title="' . $m_usernames . ' info">' . $m_username . '</a>';
    ?>
</h2>

							<p class="from"><?php 
    echo $m_country;
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:members.php

示例6: url_flag

function url_flag($size = 24, $color = "red")
{
    /* Get the URL for the flags icon Andreas made
     * Accepts 'red', 'blue' and gray color strings.
     */
    return rurl() . '/images/sauer/' . $color . 'flag' . $size . '.png';
}
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:7,代码来源:functions.php

示例7: date

    }
    /* END OLD PASWORD PATCH */
    // Mount the user array (or false)
    if ($arrUser = isUser($username_form, $password, $dbConn)) {
        if (empty($error)) {
            // $error means user is in limbo (Panda check this. Could it be from other reasons?)
            // and update last seen users (date_modify)
            $d = date("Y-m-d H:i:s");
            $query = "UPDATE users SET date_modified = '{$d}' WHERE idUser = {$arrUser['idUser']}";
            $result = mysql_query($query, $dbConn);
            // SESSION init
            $_SESSION['NC_user'] = $arrUser['username'];
            $_SESSION['NC_password'] = $arrUser['pass'];
            //$_SESSION['CSRF']=substr(md5(uniqid(rand( ), true)), 10, 15);
            // Location is the actual page except, obvioulsy, for the register page
            if (preg_match("/register.php/i", $_SERVER['REQUEST_URI'])) {
                $location = rurl();
            } else {
                $location = rurl() . $_SERVER['REQUEST_URI'];
            }
            header("Location: {$location}");
            die;
        } else {
            $arrUser = false;
        }
    } elseif (empty($error['limbo'])) {
        $error['userpass'] = 'User or password do not match.<br />
			<span style="color: #c0c0c0;">If you forgot your username or password, please
			<a href="/forgot-password.php"> click here.</a></span>';
    }
}
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:login.php

示例8: rdir

require_once '../admin/functions.php';
require_once rdir() . '/admin/connect.php';
require_once rdir() . '/admin/isUser.php';
// db connection
$dbConn = connect_db();
if (!empty($_SESSION['NC_user']) && !empty($_SESSION['NC_password'])) {
    $arrUser = isUser($_SESSION['NC_user'], $_SESSION['NC_password'], $dbConn);
}
// Number of comments to show
$n = 10;
if (empty($arrUser) || !empty($arrUser) && $arrUser['type'] == 'user') {
    // Get the Last Comments of public posts posts.
    $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser WHERE posts.postFor = 'all' ORDER BY comments.date DESC LIMIT 0,{$n}";
} else {
    // Members, friends and admins can see all...
    $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser ORDER BY comments.date DESC LIMIT 0,{$n}";
}
if ($r = mysql_query($q, $dbConn)) {
    while ($commentrow = mysql_fetch_array($r)) {
        extract(strip_slashes_arr($commentrow), EXTR_PREFIX_ALL, "lastc");
        $lastc_pic = get_user_pic($lastc_userId, 24);
        $lastc_title = '<a href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '">' . $lastc_title . '</a>';
        $lastc_content = cut_string($lastc_content, 60);
        $lastc_content = '<a class="acomm" href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '#comm_' . $lastc_idComment . '">' . $lastc_content . '</a>';
        echo '<div class="comment">';
        echo '<p><img class="userpic" src="' . $lastc_pic . '" alt="' . $lastc_username . '" title="' . $lastc_username . '"/>';
        echo '<strong>' . ' ' . $lastc_username . '</strong>, on ' . $lastc_title . ' says: ';
        echo '<em>' . $lastc_content . '</em></p>';
        echo '</div>';
    }
}
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:check-comments.php

示例9: get_the_flag

                // show message subject
                if ($is_read == '0') {
                    echo '<td class="subject"><a style="font-weight: bold;" href="messages/read.php?msg=' . $idMessage . '">' . $subject . '</a></td>';
                } else {
                    echo '<td class="subject"><a href="messages/read.php?msg=' . $idMessage . '">' . $subject . '</a></td>';
                }
                // show if it is a new message
                if ($is_read == '0') {
                    $flag = get_the_flag(24, 'blue');
                } else {
                    $flag = $flag = get_the_flag(24, 'gray');
                }
                echo '<td style="text-align: center;">' . $flag . '</td>';
                // show delete icon
                echo '<td style="text-align: center;"><a href="messages/index.php?del=' . $idMessage . ' title="Shred message" onclick="return confirm(\'Remove message?\');">
                <img src="' . rurl() . '/images/delete.png" alt="[X]"/></a></td></tr>';
                $i++;
            }
            // end while mysql_fetch_array
            echo "</table>";
        } else {
            echo "You have no messages.";
        }
    } else {
        echo "Bad db connection.";
    }
} else {
    // or user is not logged in.
    echo 'Sorry: You need to be logged in to read messages.';
}
?>
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:index.php

示例10: session_unset

<?php

// Our logout, also known as `the session destroyer`.
session_unset();
session_destroy();
$location = rurl();
header("Location: {$location}");
die;
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:8,代码来源:logout.php

示例11: rurl

					<p>
						<a href="<?php 
    echo rurl() . '/gallery/';
    ?>
" title="back to the gallery index">Back to the Gallery Index</a>
					</p>
					<h1 style="text-align: center"><?php 
    echo get_the_flag(24, "blue") . '&nbsp;&nbsp;·NC· ' . $username . '&nbsp;&nbsp;' . get_the_flag(24, "red");
    ?>
</h1>
					<div class="picasa">
						<div id="member_pics"></div>
					</div>
					<p style="text-align: center">
						<a href="<?php 
    echo rurl() . '/gallery/';
    ?>
" title="back to the gallery index">
							Back to the Gallery Index<br/><br/><?php 
    echo get_the_flag(24, 'blue');
    ?>
						</a>						
					</p>
					<?php 
}
?>
					
				</div><!-- /main -->
			</div><!-- /content-->
			<div id="footer"><?php 
include rdir() . '/includes/footer.inc.php';
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:index.php

示例12: get_random_string

    // STORE TEMPORAL USERDATA AND SEND A VALIDATION CODE
    if (empty($error)) {
        // GET A VALIDATION CODE
        $code = get_random_string() . time() . get_random_string();
        // INSERT ON PREUSERS
        $query = "INSERT INTO preusers (username, pass, email, first_name, last_name, country, homepage, code) VALUES ('{$reg_username}', '{$reg_pass}', '{$reg_email}', '{$reg_first_name}', '{$reg_last_name}', '{$reg_country}', '{$reg_homepage}', '{$code}')";
        $result = mysql_query($query, $dbConn);
        unset($query, $result);
        // SEND A MAIL WITH THE VALIDATION URL
        $to = strip_tags($reg_email);
        $subject = "No Clan: Complete your registration process";
        $link = rurl() . '/register.php?actCode=' . $code;
        $nc = rurl();
        $body = trim("Hi {$reg_username}!<br/>\n\n\t\t\t\t\tTo complete your registration process at No Clan site \n\t\t\t\t\tyou have to activate your account by clicking the following link:<br/>\n\n\t\t\t\t\t<a href='{$link}'>{$link}</a><br/>\n\n\t\t\t\t\t<br/>\n\n\t\t\t\t\t(or copy&paste the url on your browser)<br/>\n<br/>\n\n\t\t\t\t\tAnd please, know that <strong>registration at our site does not mean you are a clan member or that you may use -NC- tag to play.</strong><br/>\n<br/>\n\n\t\t\t\t\tThank you for your registration.<br/>\n\n\t\t\t\t\tNo Clan - <a href='{$nc}'>{$nc}</a><br/>\n<br/>\n");
        if (send_mail($to, $subject, $body)) {
            $location = rurl() . '/register.php?code=sent';
            header("Location: {$location}");
        } else {
            $error['send_mail'] = 'There was a problem on the validation email process. Did you sent a valid email?';
        }
    }
}
// page info
$page_title = "NoClan: Registration";
// used at 'includes/head.inc'
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<?php 
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:31,代码来源:register.php

示例13: canput

    ?>
				<input name="submitPreview" type="submit" value="PREVIEW" />
				<input name="idPost" type="hidden" value="<?php 
    canput($idPost);
    ?>
" />
				<input class="submit" name="submitEdit" type="submit" value="SAVE" onclick="return confirm('After edition, this post will go back to it\'s owner.\n\nCONFIRM EDITION');"/>
			    <?php 
}
?>
			</form>
			<?php 
if ($arrUser['type'] == 'admin') {
    $location = rurl() . '/admin/';
} else {
    $location = rurl() . '/edit/';
}
?>
			<button style="float: right; margin-top: -3.3em;" onclick="location.href='<?php 
echo $location;
?>
'">CANCEL</button>
			
			<!-- /ADD&EDIT FORM -->

		    </div><!-- /main -->

		</div><!-- /content-->
		
		<div id="footer"></div> <!-- /footer -->
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:30,代码来源:post-manager.php

示例14: rurl

?>
<!-- /Fancy -->

<!-- timers & auto-updates -->
<script language="javascript" type="text/javascript" src="/js/ajax-general.js"></script>
<!-- /timers & auto-updates -->

<!-- ANALYTICS -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-27511799-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
<!-- /ANALYTICS -->

<!-- RSS -->
<link rel="alternate" title="No Clan: News" href="<?php 
echo rurl() . '/rss/news.php';
?>
" type="application/rss+xml"/>
<!-- /RSS -->

<!-- G+ -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- /being social -->
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:30,代码来源:head.inc.php

示例15: session_start

<?php

session_start();
require_once '../admin/functions.php';
require_once rdir() . '/admin/config.php';
require_once rdir() . '/admin/connect.php';
require_once rdir() . '/admin/isUser.php';
// db connection
$dbConn = connect_db();
// Is user connected? Is admin? no? go home then.
if (!empty($_SESSION['NC_user']) && !empty($_SESSION['NC_password'])) {
    $arrUser = isUser($_SESSION['NC_user'], $_SESSION['NC_password'], $dbConn);
} else {
    go_home();
}
$idUser = $arrUser['idUser'];
$q = "SELECT idMessage FROM messages WHERE messages.to='{$idUser}' AND is_read='0'";
$r = mysql_query($q, $dbConn);
$messages = mysql_num_rows($r);
echo '<p><a href="' . rurl() . '/messages/">Messages (' . $messages . ')</a>
          &bull; <a href="' . rurl() . '/messages/full_message.php">Send a message</a></p>';
开发者ID:laiello,项目名称:no-clan-sauerbraten-website,代码行数:21,代码来源:check-messages.php


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