コード例 #1
0
ファイル: userservice.php プロジェクト: kidwellj/scuttle
 function UserService(&$db)
 {
     $this->db =& $db;
     $this->tablename = $GLOBALS['tableprefix'] . 'users';
     $this->sessionkey = $GLOBALS['cookieprefix'] . '-currentuserid';
     $this->cookiekey = $GLOBALS['cookieprefix'] . '-login';
     $this->profileurl = createURL('profile', '%2$s');
 }
コード例 #2
0
ファイル: User.php プロジェクト: MarxGonzalez/SemanticScuttle
 protected function __construct($db)
 {
     $this->db = $db;
     $this->tablename = $GLOBALS['tableprefix'] . 'users';
     $this->sessionkey = INSTALLATION_ID . '-currentuserid';
     $this->cookiekey = INSTALLATION_ID . '-login';
     $this->profileurl = createURL('profile', '%2$s');
     $this->updateSessionStability();
 }
コード例 #3
0
function matchingURL($url1, $url2)
{
    $url_obj1 = createURL($url1);
    $url_obj2 = createURL($url2);
    if ($url_obj1->host == $url_obj2->host && $url_obj1->protocol == $url_obj2->protocol && $url_obj1->port == $url_obj2->port && $url_obj1->dest == $url_obj2->dest) {
        return "True";
    } else {
        return "False";
    }
}
コード例 #4
0
function main()
{
    require '../includes/connect.php';
    $mainTickerSQL = "SELECT * FROM tickers";
    $ticker_result = mysqli_query($connect, $mainTickerSQL);
    while ($row = mysqli_fetch_array($ticker_result)) {
        $companyTicker = $row['ticker'];
        $fileURL = createURL($companyTicker);
        $companyTextFile = "../TextFiles/" . $companyTicker . ".txt";
        $file = getCsvFile($fileURL, $companyTextFile);
        fileToDatabase($companyTextFile, $companyTicker);
    }
}
コード例 #5
0
function main()
{
    $mainTickerFile = fopen("tickerMaster.txt", "r");
    $myfile = fopen("tableName.txt", "w");
    while (!feof($mainTickerFile)) {
        $companyTicker = fgets($mainTickerFile);
        $companyTicker = trim($companyTicker);
        $fileURL = createURL($companyTicker);
        $companyTxtFile = "txtFiles/" . $companyTicker . ".txt";
        getCSVFile($fileURL, $companyTxtFile);
        $tableName = fileToDatabase($companyTxtFile, $companyTicker);
        fwrite($myfile, $tableName . "\n");
    }
    fclose($myfile);
}
コード例 #6
0
/* Managing path info */
list($url, $tag) = explode('/', $_SERVER['PATH_INFO']);
//$tag        = isset($_GET['query']) ? $_GET['query'] : NULL;
$template = 'tagrename.tpl';
if (POST_CONFIRM) {
    if (trim(POST_OLD) != '') {
        $old = trim(POST_OLD);
    } else {
        $old = NULL;
    }
    if (trim(POST_NEW) != '') {
        $new = trim(POST_NEW);
    } else {
        $new = NULL;
    }
    if (!is_null($old) && !is_null($new) && $tagservice->renameTag($currentUser->getId(), $old, $new) && $b2tservice->renameTag($currentUser->getId(), $old, $new) && $tag2tagservice->renameTag($currentUser->getId(), $old, $new)) {
        $tplVars['msg'] = T_('Tag renamed');
        header('Location: ' . createURL('bookmarks', $currentUser->getUsername()));
    } else {
        $tplVars['error'] = T_('Failed to rename the tag');
        $template = 'error.500.tpl';
    }
} elseif (POST_CANCEL) {
    header('Location: ' . createURL('bookmarks', $currentUser->getUsername() . '/' . $tag));
} else {
    $tplVars['subtitle'] = T_('Rename Tag') . ': ' . $tag;
    $tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] . '/' . $tag;
    $tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
    $tplVars['old'] = $tag;
}
$templateservice->loadTemplate($template, $tplVars);
コード例 #7
0
ファイル: index.php プロジェクト: rtd/phpipam
<?php

ob_start();
/* config */
require 'config.php';
/* site functions */
require 'functions/functions.php';
# set default page
if (!isset($_GET['page'])) {
    $_GET['page'] = "dashboard";
}
# reset url for base
$url = createURL();
# if not install fetch settings etc
if ($_GET['page'] != "install") {
    # database object
    $Database = new Database_PDO();
    # check if this is a new installation
    require 'functions/checks/check_db_install.php';
    # initialize objects
    $Result = new Result();
    $User = new User($Database);
    $Sections = new Sections($Database);
    $Subnets = new Subnets($Database);
    $Tools = new Tools($Database);
    $Addresses = new Addresses($Database);
}
/** include proper subpage **/
if ($_GET['page'] == "install") {
    require "app/install/index.php";
} elseif ($_GET['page'] == "upgrade") {
コード例 #8
0
ファイル: tagrename.php プロジェクト: asymmetric/scuttle
    } else {
        $new = NULL;
    }
    if (is_null($old) || is_null($new)) {
        $tplVars['error'] = T_('Failed to rename the tag');
        $templateservice->loadTemplate('error.500.tpl', $tplVars);
        exit;
    } else {
        // Rename the tag.
        if ($tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, true)) {
            $tplVars['msg'] = T_('Tag renamed');
            $logged_on_user = $userservice->getCurrentUser();
            header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
        } else {
            $tplVars['error'] = T_('Failed to rename the tag');
            $templateservice->loadTemplate('error.500.tpl', $tplVars);
            exit;
        }
    }
} elseif ($_POST['cancel']) {
    $logged_on_user = $userservice->getCurrentUser();
    header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] . '/' . $tags));
}
$tplVars['subtitle'] = T_('Rename Tag') . ': ' . $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] . '/' . $tag;
$tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
$tplVars['old'] = $tag;
$templateservice->loadTemplate('tagrename.tpl', $tplVars);
?>
 	  	 
コード例 #9
0
ファイル: watchlist.php プロジェクト: kidwellj/scuttle
        $start = 0;
    }
    // Set template vars
    $tplVars['page'] = $page;
    $tplVars['start'] = $start;
    $tplVars['bookmarkCount'] = $start + 1;
    $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, NULL, NULL, getSortOrder(), true);
    $tplVars['sidebar_blocks'] = array('watchlist');
    $tplVars['watched'] = true;
    $tplVars['total'] = $bookmarks['total'];
    $tplVars['bookmarks'] =& $bookmarks['bookmarks'];
    $tplVars['cat_url'] = createURL('tags', '%2$s');
    $tplVars['nav_url'] = createURL('watchlist', '%s/%s%s');
    if ($user == $currentUsername) {
        $title = T_('My Watchlist');
    } else {
        $title = T_('Watchlist') . ': ' . $user;
    }
    $tplVars['pagetitle'] = $title;
    $tplVars['subtitle'] = $title;
    $tplVars['rsschannels'] = array(array(filter($sitename . ': ' . $title), createURL('rss', 'watchlist/' . filter($user, 'url'))));
    $templateservice->loadTemplate('bookmarks.tpl', $tplVars);
} else {
    $tplVars['error'] = T_('Username was not specified');
    $templateservice->loadTemplate('error.404.tpl', $tplVars);
    exit;
}
if ($usecache) {
    // Cache output if existing copy has expired
    $cacheservice->End($hash);
}
コード例 #10
0
$userid = isset($userid) ? $userid : 0;
$currenttag = isset($currenttag) ? str_replace('+', ',', $currenttag) : '';
//$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false;
$logged_on_userid = $userservice->getCurrentUserId();
$editingMode = $logged_on_userid !== false;
?>
<h2><?php 
echo T_('Linked Tags');
?>
</h2>
<div id="related">
<?php 
if ($editingMode) {
    echo '<p style="margin-bottom: 13px;text-align:center;">';
    echo ' (<a href="' . createURL('tag2tagadd', '') . '" rel="tag">' . T_('Add new link') . '</a>) ';
    echo ' (<a href="' . createURL('tag2tagdelete', '') . '" rel="tag">' . T_('Delete link') . '</a>)';
    echo '</p>';
}
?>
 <div id="related-content"></div>
 <script type="text/javascript">//<![CDATA[
jQuery("#related-content")
.jstree({
    "themes" : {
        "theme": "default",
        "dots": false,
        "icons": true,
        "url": '<?php 
echo ROOT_JS;
?>
themes/default/style.css'
コード例 #11
0
    $end = $end - $size + 1;
}
if ($mod == 1) {
    $end = $end - 1;
}
$st = $end - $size + 1;
if ($end > $totalPage) {
    $end = $totalPage;
}
if ($st <= 0) {
    $st = 1;
    $end = $size <= $totalPage ? $size : $totalPage;
}
$qs .= !empty($qs) ? '&' : '';
$url .= '?' . $qs . 'page=';
$pageList = '<div class="pagination"><ul>';
if ($currPage - 1 > 0) {
    $pageList .= sprintf('<li><a href="%s" title="上一頁">«</a></li>', createURL($url, $qs, $route, $params, $currPage - 1));
}
for ($i = $st; $i <= $end; $i++) {
    $num = str_pad($i, 2, "0", STR_PAD_LEFT);
    if ($i != $currPage) {
        $pageList .= sprintf('<li><a href="%s">%s</a></li>', createURL($url, $qs, $route, $params, $i), $num);
    } else {
        $pageList .= sprintf('<li class="active"><a href="%s">%s</a></li>', createURL($url, $qs, $route, $params, $i), $num);
    }
}
if ($currPage + 1 <= $totalPage) {
    $pageList .= sprintf('<li><a href="%s" title="上一頁">»</a></li>', createURL($url, $qs, $route, $params, $currPage + 1));
}
echo $pageList .= '</ul></div>';
コード例 #12
0
ファイル: bookmarks.tpl.php プロジェクト: asymmetric/scuttle
     switch ($others) {
         case 0:
             break;
         case 1:
             $copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend);
             break;
         default:
             $copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend);
     }
 }
 // Copy link
 if ($userservice->isLoggedOn() && $logged_on_userid != $row['uId']) {
     // Get the username of the current user
     $currentUser = $userservice->getCurrentUser();
     $currentUsername = $currentUser[$userservice->getFieldName('username')];
     $copy .= ' - <a href="' . createURL('bookmarks', $currentUsername . '?action=add&amp;address=' . urlencode($row['bAddress']) . '&amp;title=' . urlencode($row['bTitle'])) . '">' . T_('Copy') . '</a>';
 }
 // Nofollow option
 $rel = '';
 if ($GLOBALS['nofollow']) {
     $rel = ' rel="nofollow"';
 }
 $address = filter($row['bAddress']);
 // Redirection option
 if ($GLOBALS['useredir']) {
     $address = $GLOBALS['url_redir'] . $address;
 }
 // Output
 echo '<li class="xfolkentry' . $access . '">' . "\n";
 echo '<div class="link"><a href="' . $address . '"' . $rel . ' class="taggedlink">' . filter($row['bTitle']) . "</a></div>\n";
 if ($row['bDescription'] != '') {
コード例 #13
0
ファイル: profile.tpl.php プロジェクト: kidwellj/scuttle
    foreach ($watching as $watchuser) {
        $list .= '<a href="' . createURL('bookmarks', $watchuser) . '">' . $watchuser . '</a>, ';
    }
    echo substr($list, 0, -2);
    ?>
        </dd>
<?php 
}
$watchnames = $userservice->getWatchNames($userid, true);
if ($watchnames) {
    ?>
    <dt><?php 
    echo T_('Watched By');
    ?>
</dt>
        <dd>
            <?php 
    $list = '';
    foreach ($watchnames as $watchuser) {
        $list .= '<a href="' . createURL('bookmarks', $watchuser) . '">' . $watchuser . '</a>, ';
    }
    echo substr($list, 0, -2);
    ?>
        </dd>
<?php 
}
?>
</dl>

<?php 
$this->includeTemplate($GLOBALS['bottom_include']);
コード例 #14
0
<?php

/* Service creation: only useful services are created */
//No specific services
if ($userservice->isLoggedOn()) {
    if ($currentUser->getUsername() != $user) {
        $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
        if ($result) {
            $linkText = T_('Remove from Watchlist');
        } else {
            $linkText = T_('Add to Watchlist');
        }
        $linkAddress = createURL('watch', $user);
        ?>

<h2><?php 
        echo T_('Actions');
        ?>
</h2>
<div id="watchlist">
    <ul>
        <li><a href="<?php 
        echo $linkAddress;
        ?>
"><?php 
        echo $linkText;
        ?>
</a></li>
    </ul>
</div>
コード例 #15
0
ファイル: links.php プロジェクト: joseph-mudloff/pixie-cms
         // ok so the visitor has come along to www.mysite.com/links/tag/something lets show them all links tagged "something"
         case 'tag':
             // we need $x to be a valid variable so lets check it
             $x = squash_slug($x);
             $rz = safe_rows('*', 'pixie_module_links', "tags REGEXP '[[:<:]]" . $x . "[[:>:]]'");
             if ($rz) {
                 // we have found a entry tagged "something" to lets change the page title to reflect that
                 // first lets get the current sites title
                 $site_title = safe_field('site_name', 'pixie_settings', "settings_id = '1'");
                 // $ptitle will overwrite the current page title
                 $ptitle = $site_title . " - Links - Tagged - {$x}";
             } else {
                 // no tags were found, lets redirect back to the defualt view again.
                 // createURL is your friend... its one of the most useful functions in Pixie
                 if (isset($s)) {
                     $redirect = createURL($s);
                     header("Location: {$redirect}");
                 }
                 exit;
             }
             break;
         default:
             // By default this module is called the links module, Pixie will work this out for us so I do not need
             // to set $ptitle here. Pixie will always TRY and create a unique, accurate page title if one is not set.
             break;
     }
     break;
     // Head
     // This will output code into the end of the head section of the HTML, this allows you to load in external CSS, JavaScript etc
 // Head
 // This will output code into the end of the head section of the HTML, this allows you to load in external CSS, JavaScript etc
コード例 #16
0
<ul>
<li><?php 
echo T_('<strong>Store</strong> all your favourite links in one place, accessible from anywhere.');
?>
</li>
<li><?php 
echo T_('<strong>Share</strong> your bookmarks with everyone, with friends on your watchlist or just keep them private.');
?>
</li>
<li><?php 
echo T_('<strong>Tag</strong> your bookmarks with as many labels as you want, instead of wrestling with folders.');
?>
</li>
<li><?php 
echo sprintf('<strong><a href="' . createURL('register') . '">' . T_('Register now') . '</a> </strong>' . T_(' to start using %s!'), $GLOBALS['sitename']);
?>
</li>
</ul>

<h3><?php 
echo T_('Geek Stuff');
?>
</h3>
<ul>
<li><a href="http://sourceforge.net/projects/semanticscuttle/">Semantic Scuttle</a> <?php 
echo T_('is licensed under the ');
?>
 <a href="http://www.gnu.org/copyleft/gpl.html"><acronym title="GNU\'s Not Unix">GNU</acronym> General Public License</a> (<?php 
echo T_('you can freely host it on your own web server.');
?>
コード例 #17
0
    } elseif (!POST_EMAIL) {
        $tplVars['error'] = T_('You must enter your <abbr title="electronic mail">e-mail</abbr> address.');
        // USERNAME AND E-MAIL
    } else {
        // NO MATCH
        $userinfo = $userservice->getObjectUserByUsername(POST_USERNAME);
        if ($userinfo == NULL) {
            $tplVars['error'] = T_('No matches found for that username.');
        } elseif (POST_EMAIL != $userinfo->getEmail()) {
            $tplVars['error'] = T_('No matches found for that combination of username and <abbr title="electronic mail">e-mail</abbr> address.');
            // MATCH
        } else {
            // GENERATE AND STORE PASSWORD
            $password = $userservice->generatePassword($userinfo->getId());
            if (!($password = $userservice->generatePassword($userinfo->getId()))) {
                $tplVars['error'] = T_('There was an error while generating your new password. Please try again.');
            } else {
                // SEND E-MAIL
                $message = T_('Your new password is:') . "\n" . $password . "\n\n" . T_('To keep your bookmarks secure, you should change this password in your profile the next time you log in.');
                $message = wordwrap($message, 70);
                $headers = 'From: ' . $adminemail;
                $mail = mail(POST_EMAIL, sprintf(T_('%s Account Information'), $sitename), $message);
                $tplVars['msg'] = sprintf(T_('New password generated and sent to %s'), POST_EMAIL);
            }
        }
    }
}
$templatename = 'password.tpl';
$tplVars['subtitle'] = T_('Forgotten Password');
$tplVars['formaction'] = createURL('password');
$templateservice->loadTemplate($templatename, $tplVars);
コード例 #18
0
<!--following code is generated by templates/bottom.inc.php-->
<div id="bottom">
<?php 
echo $GLOBALS['footerMessage'] . ' ';
echo '<a href="' . createURL('about') . '">' . T_('About') . '</a>';
echo ' - ';
echo T_("Propulsed by ");
echo " <a href=\"https://sourceforge.net/projects/semanticscuttle/\">SemanticScuttle</a>";
?>

</div>


<?php 
if (isset($GLOBALS['googleAnalyticsCode']) && $GLOBALS['googleAnalyticsCode'] != '') {
    ?>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("<?php 
    echo $GLOBALS['googleAnalyticsCode'];
    ?>
");
pageTracker._trackPageview();
} catch(err) {}</script>

<?php 
コード例 #19
0
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
    $logged_on_userid = NULL;
}
$popularTags =& $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid);
$popularTags =& $b2tservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc');
if ($popularTags && count($popularTags) > 0) {
    ?>

<h2><?php 
    echo T_('Popular Tags');
    ?>
</h2>
<div id="popular">
    <p class="tags">
    <?php 
    $contents = '';
    if (strlen($user) == 0) {
        $cat_url = createURL('tags', '%2$s');
    }
    foreach ($popularTags as $row) {
        $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
        $contents .= '<a href="' . sprintf($cat_url, $user, filter($row['tag'], 'url')) . '" title="' . $row['bCount'] . ' ' . $entries . '" rel="tag" style="font-size:' . $row['size'] . '">' . filter($row['tag']) . '</a> ';
    }
    echo $contents . "\n";
    ?>
    </p>
</div>

<?php 
}
コード例 #20
0
ファイル: edit.php プロジェクト: kidwellj/scuttle
                        header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
                    }
                }
            }
        } else {
            if ($_POST['delete']) {
                // Delete bookmark
                if ($bookmarkservice->deleteBookmark($bookmark)) {
                    $logged_on_user = $userservice->getCurrentUser();
                    if (isset($_POST['referrer'])) {
                        header('Location: ' . $_POST['referrer']);
                    } else {
                        header('Location: ' . createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
                    }
                    exit;
                } else {
                    $tplVars['error'] = T_('Failed to delete the bookmark');
                    $templateservice->loadTemplate('error.500.tpl', $tplVars);
                    exit;
                }
            }
        }
    }
    $tplVars['popup'] = isset($_GET['popup']) ? $_GET['popup'] : null;
    $tplVars['row'] =& $row;
    $tplVars['formaction'] = createURL('edit', $bookmark);
    $tplVars['btnsubmit'] = T_('Save Changes');
    $tplVars['showdelete'] = true;
    $tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
    $templateservice->loadTemplate('editbookmark.tpl', $tplVars);
}
コード例 #21
0
ファイル: tags.php プロジェクト: kidwellj/scuttle
}
// Header variables
$tplVars['pagetitle'] = $pagetitle;
$tplVars['loadjs'] = true;
$tplVars['rsschannels'] = array(array(filter($sitename . ': ' . $pagetitle), createURL('rss', 'all/' . filter($cat, 'url'))));
// Pagination
$perpage = getPerPageCount();
if (isset($_GET['page']) && intval($_GET['page']) > 1) {
    $page = $_GET['page'];
    $start = ($page - 1) * $perpage;
} else {
    $page = 0;
    $start = 0;
}
$tplVars['page'] = $page;
$tplVars['start'] = $start;
$tplVars['popCount'] = 25;
$tplVars['currenttag'] = $cat;
$tplVars['sidebar_blocks'] = array('related', 'popular');
$tplVars['subtitle'] = filter($pagetitle);
$tplVars['bookmarkCount'] = $start + 1;
$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, $cat, NULL, getSortOrder());
$tplVars['total'] = $bookmarks['total'];
$tplVars['bookmarks'] =& $bookmarks['bookmarks'];
$tplVars['cat_url'] = createURL('tags', '%2$s');
$tplVars['nav_url'] = createURL('tags', '%2$s%3$s');
$templateservice->loadTemplate('bookmarks.tpl', $tplVars);
if ($usecache) {
    // Cache output if existing copy has expired
    $cacheservice->End($hash);
}
コード例 #22
0
    // Template variables
    $bookmarks = $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, NULL, NULL, $hash);
    $tplVars['pagetitle'] = T_('History') . ': ' . $bookmark['bAddress'];
    $tplVars['subtitle'] = sprintf(T_('History for %s'), $bookmark['bAddress']);
    $tplVars['loadjs'] = true;
    $tplVars['page'] = $page;
    $tplVars['start'] = $start;
    $tplVars['bookmarkCount'] = $start + 1;
    $tplVars['total'] = $bookmarks['total'];
    $tplVars['bookmarks'] = $bookmarks['bookmarks'];
    $tplVars['hash'] = $hash;
    $tplVars['popCount'] = 50;
    $tplVars['sidebar_blocks'] = array('common');
    //$tplVars['cat_url'] = createURL('tags', '%2$s');
    $tplVars['cat_url'] = createURL('bookmarks', '%1$s/%2$s');
    $tplVars['nav_url'] = createURL('history', $hash . '/%3$s');
    $tplVars['rsschannels'] = array();
    if ($userservice->isLoggedOn()) {
        $tplVars['user'] = $currentUser->getUsername();
    } else {
        $tplVars['user'] = '';
    }
    $templateservice->loadTemplate('bookmarks.tpl', $tplVars);
} else {
    // Throw a 404 error
    $tplVars['error'] = T_('Address was not found');
    $templateservice->loadTemplate('error.404.tpl', $tplVars);
    exit;
}
if ($usecache) {
    // Cache output if existing copy has expired
コード例 #23
0
/**
 * Functions to check if user is authenticated properly
 *
 * If not redirect to login!
 */
function isUserAuthenticatedNoAjax()
{
    /* open session and get username / pass */
    if (!isset($_SESSION)) {
        global $phpsessname;
        if (strlen($phpsessname) > 0) {
            session_name($phpsessname);
        }
        session_start();
    }
    /* redirect if not authenticated */
    if (empty($_SESSION['ipamusername'])) {
        # save requested page
        $_SESSION['phpipamredirect'] = $_SERVER['SCRIPT_URI'];
        $url = createURL();
        # redirect
        header("Location:" . $url . create_link("login", "timeout"));
    } else {
        if ($_GET['page'] != "login" && $_GET['page'] != "request_ip" && $_GET['page'] != "upgrade" && $_GET['page'] != "install") {
            global $settings;
            /* check inactivity time */
            if (strlen($settings['inactivityTimeout'] > 0) && time() - $_SESSION['lastactive'] > $settings['inactivityTimeout']) {
                # redirect
                $url = createURL();
                header("Location:" . $url . create_link("login", "timeout"));
            }
        }
        reset_inactivity_time();
    }
    /* close session */
    session_write_close();
}
コード例 #24
0
" title="<?php 
    echo "{$page_display_name}: {$lang['popular_posts']}";
    ?>
"<?php 
    if ($m == 'popular') {
        echo " class=\"sub_nav_current_1\"";
    }
    ?>
><?php 
    echo $lang['popular_posts'];
    ?>
</a>
		</li>
		<li>
			<a href="<?php 
    echo createURL($page_name, 'tags');
    ?>
" title="<?php 
    echo "{$page_display_name}: {$lang['tags']}";
    ?>
"<?php 
    if ($m == 'tags') {
        echo " class=\"sub_nav_current_1\"";
    }
    ?>
><?php 
    echo $lang['tags'];
    ?>
</a>
		</li>
	</ul>
コード例 #25
0
<div>Bubblesort Example:</div>

<div style="padding:20px">

  <?php 
$this->setType("bubble");
$this->setData(array(1, 6, 34, 7, 43, 9, 2, 4, 5));
echo "Array: ";
foreach ($this->getData() as $num) {
    echo $num . " ";
}
echo "<br>";
$this->sort();
echo $this->getType() . ": ";
foreach ($this->getData() as $num) {
    echo $num . " ";
}
?>

</div>


<div><a href="<?php 
createURL();
?>
">Go Home</a></div>
コード例 #26
0
 * @license     GPL http://www.gnu.org/licenses/gpl.html
 * @link        http://sourceforge.net/projects/semanticscuttle
 */
/* Service creation: only useful services are created */
$searchhistoryservice = SemanticScuttle_Service_Factory::get('SearchHistory');
$lastSearches = $searchhistoryservice->getAllSearches('all', NULL, 3, NULL, true, false);
if ($lastSearches && count($lastSearches) > 0) {
    ?>

<h2><?php 
    echo T_('Last Searches');
    ?>
</h2>
<div id="searches">
 <table>
<?php 
    foreach ($lastSearches as $row) {
        echo '  <tr><td>';
        echo '<a href="' . htmlspecialchars(createURL('search', $range . '/' . $row['shTerms'])) . '">';
        echo htmlspecialchars($row['shTerms']);
        echo '</a>';
        echo ' <span title="' . T_('Number of bookmarks for this query') . '">(' . $row['shNbResults'] . ')</span>';
        echo '</td></tr>' . "\n";
    }
    //echo '<tr><td><a href="'.createURL('users').'">...</a></td></tr>';
    ?>

 </table>
</div>
<?php 
}
コード例 #27
0
ファイル: class.User.php プロジェクト: rtd/phpipam
 /**
  * checks if user is authenticated, if not redirects to login page
  *
  * @access public
  * @param bool $redirect (default: true)
  * @return void
  */
 public function check_user_session($redirect = true)
 {
     # not authenticated
     if ($this->authenticated === false && $redirect) {
         # set url
         $url = createURL();
         # error print for AJAX
         if (@$_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest") {
             # for AJAX always check origin
             $this->check_referrer();
             # kill session
             $this->destroy_session();
             # error
             $this->Result->show("danger", _('Please login first') . "!<hr><a class='btn btn-sm btn-default' href='" . $url . create_link("login") . "'>" . _('Login') . "</a>", true, true);
         } elseif ($this->timeout) {
             # set redirect cookie
             $this->set_redirect_cookie();
             header("Location:" . $url . create_link("login", "timeout"));
         } else {
             # set redirect cookie
             $this->set_redirect_cookie();
             header("Location:" . $url . create_link("login"));
         }
     }
 }
コード例 #28
0
ファイル: editbookmark.tpl.php プロジェクト: kidwellj/scuttle
<\/a><\/li>');
document.write('<\/ul>');
</script>

<h3><?php 
    echo T_('Import');
    ?>
</h3>
<ul>
    <li><a href="<?php 
    echo createURL('importNetscape');
    ?>
"><?php 
    echo T_('Import bookmarks from bookmark file');
    ?>
</a> (<?php 
    echo T_('Internet Explorer, Mozilla Firefox and Netscape');
    ?>
)</li>
    <li><a href="<?php 
    echo createURL('import');
    ?>
"><?php 
    echo T_('Import bookmarks from del.icio.us');
    ?>
</a></li>
</ul>

<?php 
}
$this->includeTemplate($GLOBALS['bottom_include']);
コード例 #29
0
ファイル: alltags.php プロジェクト: hrepp/SemanticScuttle
// Header variables
$pagetitle = T_('All Tags');
if (isset($user) && $user != '') {
    $userid = $userservice->getIdFromUser($user);
    if ($userid == NULL) {
        $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
        $templateservice->loadTemplate('error.404.tpl', $tplVars);
        exit;
    }
    $pagetitle .= ': ' . ucfirst($user);
} else {
    $userid = NULL;
}
$tags =& $b2tservice->getTags($userid);
$tplVars['tags'] =& $b2tservice->tagCloud($tags, 5, 90, 225, getSortOrder());
$tplVars['user'] = $user;
if (isset($userid)) {
    $tplVars['cat_url'] = createURL('bookmarks', '%s/%s');
} else {
    $tplVars['cat_url'] = createURL('tags', '%2$s');
}
$tplVars['sidebar_blocks'] = array('linked');
$tplVars['userid'] = $userid;
$tplVars['loadjs'] = true;
$tplVars['pagetitle'] = $pagetitle;
$tplVars['subtitle'] = $pagetitle;
$templateservice->loadTemplate('tags.tpl', $tplVars);
if ($usecache) {
    // Cache output if existing copy has expired
    $cacheservice->End($hash);
}
コード例 #30
0
ファイル: search.php プロジェクト: asymmetric/scuttle
                break;
        }
        if (isset($s_user)) {
            if (is_numeric($s_user)) {
                $s_user = intval($s_user);
            } else {
                if (!($userinfo = $userservice->getUserByUsername($s_user))) {
                    $tplVars['error'] = sprintf(T_('User with username %s was not found'), $s_user);
                    $templateservice->loadTemplate('error.404.tpl', $tplVars);
                    exit;
                } else {
                    $s_user =& $userinfo[$userservice->getFieldName('primary')];
                }
            }
        }
    }
    $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $s_user, NULL, $terms, getSortOrder(), $s_watchlist, $s_start, $s_end);
    $tplVars['page'] = $page;
    $tplVars['start'] = $start;
    $tplVars['popCount'] = 25;
    $tplVars['sidebar_blocks'] = array('recent');
    $tplVars['range'] = $range;
    $tplVars['terms'] = $terms;
    $tplVars['pagetitle'] = T_('Search Bookmarks');
    $tplVars['bookmarkCount'] = $start + 1;
    $tplVars['total'] = $bookmarks['total'];
    $tplVars['bookmarks'] =& $bookmarks['bookmarks'];
    $tplVars['cat_url'] = createURL('tags', '%2$s');
    $tplVars['nav_url'] = createURL('search', $range . '/' . $terms . '/%3$s');
    $templateservice->loadTemplate('bookmarks.tpl', $tplVars);
}