本文整理汇总了PHP中setting_fetch函数的典型用法代码示例。如果您正苦于以下问题:PHP setting_fetch函数的具体用法?PHP setting_fetch怎么用?PHP setting_fetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setting_fetch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: settings_page
function settings_page($args)
{
if ($args[1] == 'save') {
$settings['browser'] = $_POST['browser'];
$settings['gwt'] = $_POST['gwt'];
$settings['colours'] = $_POST['colours'];
$settings['reverse'] = $_POST['reverse'];
setcookie_year('settings', base64_encode(serialize($settings)));
twitter_refresh('');
}
$modes = array('mobile' => 'Normal phone', 'touch' => 'Touch phone', 'desktop' => 'PC/Laptop', 'text' => 'Text only', 'worksafe' => 'Work Safe', 'bigtouch' => 'Big Touch');
$gwt = array('off' => 'direct', 'on' => 'via GWT');
$colour_schemes = array();
foreach ($GLOBALS['colour_schemes'] as $id => $info) {
list($name, $colours) = explode('|', $info);
$colour_schemes[$id] = $name;
}
$content .= '<form action="settings/save" method="post"><p>Colour scheme:<br /><select name="colours">';
$content .= theme('options', $colour_schemes, setting_fetch('colours', 1));
$content .= '</select></p><p>Mode:<br /><select name="browser">';
$content .= theme('options', $modes, $GLOBALS['current_theme']);
$content .= '</select></p><p>External links go:<br /><select name="gwt">';
$content .= theme('options', $gwt, setting_fetch('gwt', $GLOBALS['current_theme'] == 'text' ? 'on' : 'off'));
$content .= '</select><small><br />Google Web Transcoder (GWT) converts third-party sites into small, speedy pages suitable for older phones and people with less bandwidth.</small></p>';
$content .= '<p><label><input type="checkbox" name="reverse" value="yes" ' . (setting_fetch('reverse') == 'yes' ? ' checked="checked" ' : '') . ' /> Attempt to reverse the conversation thread view.</label></p>';
$content .= '<p><input type="submit" value="Save" /></p></form>';
$content .= '<hr /><p>Visit <a href="reset">Reset</a> if things go horribly wrong - it will log you out and clear all settings.</p>';
return theme('page', 'Settings', $content);
}
开发者ID:novasarii,项目名称:dabr,代码行数:29,代码来源:settings.php
示例2: theme_menu_both
function theme_menu_both($menu)
{
$links = array();
foreach (menu_visible_items() as $url => $page) {
$title = $url ? $url : 'home';
$title = ucwords(str_replace("-", " ", $title));
if ('yes' == setting_fetch('menu_icons')) {
$display = $page['display'];
$class = "menu";
} else {
$display = $title . " |";
$class = "menu-text";
}
if (!$url) {
$url = BASE_URL;
}
// Shouldn't be required, due to <base> element but some browsers are stupid.
// if ($menu == 'bottom' ) { //&& isset($page['accesskey'])) {
// $links[] = "<a href='$url'>$title</a> {$page['accesskey']}";
// } else {
// // $links[] = "<a href='$url'>$title</a>";
// }
$links[] = "<a href=\"{$url}\" title=\"{$title}\">{$display}</a>";
}
if (user_is_authenticated()) {
// $user = user_current_username();
// array_unshift($links, "<b><a href='user/$user'>$user</a></b>");
}
if ($menu == 'bottom') {
// $links[] = "<a href='{$_GET['q']}' accesskey='5'>refresh</a> 5";
}
return "<div class='{$class}' id='menu'>" . implode(' ', $links) . '</div>';
}
开发者ID:icheyne,项目名称:Dabr,代码行数:33,代码来源:menu.php
示例3: css
function css()
{
// Get the colours that the user has chosen
$c = theme('colours');
$css = "@charset \"UTF-8\";\n\n@font-face {\n\tfont-family: 'icons';\n\tsrc: url('" . BASE_URL . "i/fonts/dabr-icons.eot');\n\tsrc: url('" . BASE_URL . "i/fonts/dabr-icons.eot#iefix') format('embedded-opentype'),\n\t url('" . BASE_URL . "i/fonts/dabr-icons.woff2') format('woff2'),\n\t url('" . BASE_URL . "i/fonts/dabr-icons.woff') format('woff'),\n\t url('" . BASE_URL . "i/fonts/dabr-icons.ttf') format('truetype'),\n\t url('" . BASE_URL . "i/fonts/dabr-icons.svg#dabr') format('svg');\n\tfont-weight: normal;\n\tfont-style: normal;\n}\n\nbody{\n\tmargin:0;\n\tfont-family: '" . urldecode(substr(setting_fetch("dabr_fonts", "Raleway"), 0, -4)) . "', sans;\n\tfont-size: " . setting_fetch("dabr_font_size", "1") . "em;\n\tbackground:#{$c->body_background};\n\tcolor:#{$c->body_text};\n}\n\nselect,button,input {\n\tfont-size:0.9em;\n}\n\n.embedded-tweet{\n\tborder : 0.1em solid #{$c->menu_background};\n\tmargin-left: 0.5em;\n\t/*\n\twidth: -moz-min-content;\n\twidth: -webkit-min-content;\n\twidth: min-content;\n\t*/\n}\n\nfieldset {\n\tborder-radius:1em;\n\tmax-width:30em;\n}\n\n#twitterbird {\n\tcolor: #00acee;\n}\ntextarea {\n\twidth: 100%;\n\tborder-radius: 0.5em;\n\tmax-width: 39.5em;\n}\n.fileinputs {\n\tfloat: right;\n\tdirection: rtl;\n\tmargin-right: 1em;\n}\n#geo {\n\tfloat:right;\n}\n\n.profile,.bottom {\n\tpadding: 0.5em;\n}\n\n.bottom {\n\ttext-align: center;\n}\n\n.actionicons {\n\tdisplay: block;\n\tmargin: 0.3em;\n\tclear: both;\n}\n.actionicons a{\n\tfont-family:icons,sans-serif;\n\tfont-size: 1.2em;\n\ttext-decoration: none;\n}\n.actionicons .action-text {\n\tfont-size:0.9em;\n}\n\n.icons {\n\tfont-family:icons,sans-serif;\n\tfont-size: 1em;\n}\n\n.button {\n\ttext-decoration: none;\n\tbackground-color: #EEE;\n\tcolor: #333;\n\tpadding: 0.1em 1em;\n\tborder: 0.15em solid black;\n}\n\n.button-div {\n\tmargin-top:0.25em;\n\tmargin-bottom:0.25em;\n}\n\n.action {\n\tfont-family:icons,sans-serif;\n\ttext-decoration: none;\n}\n\nform{margin:.3em;}\n\na{color:#{$c->links}}\n\nsmall,small a{\n\tcolor:#{$c->small}\n}\n.odd{\n\tbackground:#{$c->odd};\n}\n.even{\n\tbackground:#{$c->even};\n}\n.reply{\n\tbackground:#{$c->replyodd};\n}\n.reply.even{\n\tbackground:#{$c->replyeven};\n}\n\n.menu{\n\tcolor:#{$c->menu_text};\n\tbackground:#{$c->menu_background};\n\tpadding: 0.2em;\n\tfont-family:icons,sans-serif;\n\tfont-size: 1.75em;\n\twidth:95%;\n}\n\n.menu-text{\n\tbackground:#{$c->menu_background};\n\tfont-family:sans-serif;\n\twidth:95%;\n}\n\n.menu-float {\n\tposition:fixed;\n\tz-index:1;\n\twidth:100%;\n}\n\n.menu a{\n\tcolor:#{$c->menu_link};\n\ttext-decoration: none;\n}\n\n.menu-text a{\n\tcolor:#{$c->menu_link};\n\ttext-decoration: none;\n}\n\n.tweet{\n\tpadding: 0.5em;\n}\n\n.timeline a img{\n\t/*padding:2px;*/\n}\n\n.avatar{\n\theight: auto;\n\twidth: auto;\n\tfloat: left;\n\tmargin-right: 0.5em;\n}\n\n.shift{\n}\n\n.status {\n\tword-wrap:break-word;\n\tmin-height:50px;\n}\n\n.embed{\n\tleft: 0px;\n\tdisplay: block;\n\toverflow-x: auto;\n\tclear: both;\n\tmax-width: 600px;\n}\n.embedded {\n\t/*max-width:80%;*/\n\tmax-width:100%;\n\theight:auto;\n\tmargin-top: 0.25em;\n}\n.media{\n\tleft: 0px;\n\tdisplay: block;\n\toverflow-x: auto;\n\tclear: both;\n\tmax-width:100%;\n}\n.media img{\n\tmax-width:95%;\n\theight:auto;\n}\n\n.date{\n\tpadding:0.5em;\n\tfont-size:0.8em;\n\tfont-weight:bold;\n\tcolor:#{$c->small}\n}\n\n.about{\n\tcolor:#{$c->small}\n}\n\n.time{\n\tfont-size:1em;\n\tcolor:#{$c->small}\n}\n\n.from{\n\tfont-size:0.75em;\n\tcolor:#{$c->small};\n\tfont-family:serif;\n}\n.from a{\n\tcolor:#{$c->small};\n}\n.table {\n\tdisplay: table;\n\tmax-width:95%;\n}\n.table-row {\n\tdisplay: table-row;\n\ttext-align: right;\n\tword-wrap:break-word;\n}\n.table-cell {\n\tdisplay: table-cell;\n}\n.table-cell-middle,.table-cell-end {\n\tdisplay: table-cell;\n\tpadding-left: 1em;\n\tpadding-right:1em;\n}\n";
header('Content-Type: text/css; charset=utf-8');
echo $css;
}
开发者ID:vinazol,项目名称:Dabr,代码行数:8,代码来源:css.php
示例4: bigtouch_theme_avatar
function bigtouch_theme_avatar($url, $name = '', $force_large = false)
{
if (setting_fetch('avataro', 'yes') !== 'yes') {
return "<img src='{$url}' alt='{$name}' width='48' height='48' />";
} else {
return '';
}
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:8,代码来源:bigtouch.php
示例5: blackberry_theme_avatar
function blackberry_theme_avatar($url, $force_large = false)
{
if (setting_fetch('avataro', 'yes') !== 'yes') {
return "<img src='{$url}' width='48' height='48' />";
} else {
return '';
}
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:8,代码来源:blackberry.php
示例6: desktop_theme_css
function desktop_theme_css()
{
$out = theme_css();
if (setting_fetch('avataro', 'yes') == 'yes') {
$out .= '<link rel="stylesheet" href="' . BASE_URL . 'browsers/desktop.avatar.css" />';
}
$out .= '<style type="text/css">' . setting_fetch('css') . '</style>';
return $out;
}
开发者ID:xctcc,项目名称:npt,代码行数:9,代码来源:desktop.php
示例7: settings_page
function settings_page($args)
{
if ($args[1] == 'save') {
$settings['browser'] = $_POST['browser'];
$settings['gwt'] = $_POST['gwt'];
$settings['colours'] = $_POST['colours'];
$settings['reverse'] = $_POST['reverse'];
$settings['timestamp'] = $_POST['timestamp'];
$settings['hide_inline'] = $_POST['hide_inline'];
$settings['utc_offset'] = (double) $_POST['utc_offset'];
// Save a user's oauth details to a MySQL table
if (MYSQL_USERS == 'ON' && ($newpass = $_POST['newpassword'])) {
user_is_authenticated();
list($key, $secret) = explode('|', $GLOBALS['user']['password']);
$sql = sprintf("REPLACE INTO user (username, oauth_key, oauth_secret, password) VALUES ('%s', '%s', '%s', MD5('%s'))", mysql_escape_string(user_current_username()), mysql_escape_string($key), mysql_escape_string($secret), mysql_escape_string($newpass));
mysql_query($sql);
}
setcookie_year('settings', base64_encode(serialize($settings)));
twitter_refresh('');
}
$modes = array('mobile' => 'Normal phone', 'touch' => 'Touch phone', 'desktop' => 'PC/Laptop', 'text' => 'Text only', 'worksafe' => 'Work Safe', 'bigtouch' => 'Big Touch');
$gwt = array('off' => 'direct', 'on' => 'via GWT');
$colour_schemes = array();
foreach ($GLOBALS['colour_schemes'] as $id => $info) {
list($name, $colours) = explode('|', $info);
$colour_schemes[$id] = $name;
}
$utc_offset = setting_fetch('utc_offset', 0);
/* returning 401 as it calls http://api.twitter.com/1/users/show.json?screen_name= (no username???)
if (!$utc_offset) {
$user = twitter_user_info();
$utc_offset = $user->utc_offset;
}
*/
if ($utc_offset > 0) {
$utc_offset = '+' . $utc_offset;
}
$content .= '<form action="settings/save" method="post"><p>Colour scheme:<br /><select name="colours">';
$content .= theme('options', $colour_schemes, setting_fetch('colours', 1));
$content .= '</select></p><p>Mode:<br /><select name="browser">';
$content .= theme('options', $modes, $GLOBALS['current_theme']);
$content .= '</select></p><p>External links go:<br /><select name="gwt">';
$content .= theme('options', $gwt, setting_fetch('gwt', $GLOBALS['current_theme'] == 'text' ? 'on' : 'off'));
$content .= '</select><small><br />Google Web Transcoder (GWT) converts third-party sites into small, speedy pages suitable for older phones and people with less bandwidth.</small></p>';
$content .= '<p><label><input type="checkbox" name="reverse" value="yes" ' . (setting_fetch('reverse') == 'yes' ? ' checked="checked" ' : '') . ' /> Attempt to reverse the conversation thread view.</label></p>';
$content .= '<p><label><input type="checkbox" name="timestamp" value="yes" ' . (setting_fetch('timestamp') == 'yes' ? ' checked="checked" ' : '') . ' /> Show the timestamp ' . twitter_date('H:i') . ' instead of 25 sec ago</label></p>';
$content .= '<p><label><input type="checkbox" name="hide_inline" value="yes" ' . (setting_fetch('hide_inline') == 'yes' ? ' checked="checked" ' : '') . ' /> Hide inline media (eg TwitPic thumbnails)</label></p>';
$content .= '<p><label>The time in UTC is currently ' . gmdate('H:i') . ', by using an offset of <input type="text" name="utc_offset" value="' . $utc_offset . '" size="3" /> we display the time as ' . twitter_date('H:i') . '.<br />It is worth adjusting this value if the time appears to be wrong.</label></p>';
// Allow users to choose a Dabr password if accounts are enabled
if (MYSQL_USERS == 'ON' && user_is_authenticated()) {
$content .= '<fieldset><legend>Dabr account</legend><small>If you want to sign in to Dabr without going via Twitter.com in the future, create a password and we\'ll remember you.</small></p><p>Change Dabr password<br /><input type="password" name="newpassword" /><br /><small>Leave blank if you don\'t want to change it</small></fieldset>';
}
$content .= '<p><input type="submit" value="Save" /></p></form>';
$content .= '<hr /><p>Visit <a href="reset">Reset</a> if things go horribly wrong - it will log you out and clear all settings.</p>';
return theme('page', 'Settings', $content);
}
开发者ID:hnprashanth,项目名称:dabr-installer,代码行数:56,代码来源:settings.php
示例8: desktop_theme_status_form
function desktop_theme_status_form($text = '', $in_reply_to_id = NULL, $is_desktop = true)
{
if (user_is_authenticated()) {
$fixedtags = setting_fetch('fixedtago', 'no') == "yes" && $text == '' ? " #" . setting_fetch('fixedtagc') : null;
$output = '<form method="post" action="' . BASE_URL . 'update"><textarea id="status" name="status" rows="3" style="width:100%; max-width: 400px;">' . $text . $fixedtags . '</textarea><div><input name="in_reply_to_id" value="' . $in_reply_to_id . '" type="hidden" /><input type="submit" value="' . __('Update') . '" /> <span id="remaining">140</span> ';
if (substr($_GET["q"], 0, 4) !== "user") {
$output .= ' <a href="' . BASE_URL . 'upload">' . __('Upload Picture') . '</a>';
}
$output .= '</div></form>';
return $output;
}
}
开发者ID:noviachen,项目名称:netputweets,代码行数:12,代码来源:desktop.php
示例9: twitter_lists_tweets
function twitter_lists_tweets($user, $list)
{
// Tweets belonging to a list
$count = setting_fetch('tpp', 20);
$url = API_ROOT . "lists/statuses.json?slug={$list}&owner_screen_name={$user}&include_entities=true&include_rts=true&count={$count}";
if ($_GET['max_id']) {
$url .= "&max_id=" . $_GET['max_id'];
}
if ($_GET['since_id']) {
$url .= "&since_id=" . $_GET['since_id'];
}
return twitter_process($url);
}
开发者ID:xctcc,项目名称:npt,代码行数:13,代码来源:lists.php
示例10: blackberry_theme_menu_bottom
function blackberry_theme_menu_bottom()
{
$links = array();
$links[] = "<a href='" . BASE_URL . "'>" . __("Home") . "</a>";
if (user_is_authenticated()) {
if (setting_fetch('replies') == 'yes') {
$links[] = "<a href='" . BASE_URL . "replies'>" . __("Replies") . "</a>";
}
if (setting_fetch('retweets') == 'yes') {
$links[] = "<a href='" . BASE_URL . "retweets'>" . __("Retweets") . "</a>";
}
if (setting_fetch('directs') == 'yes') {
$links[] = "<a href='" . BASE_URL . "directs'>" . __("Directs") . "</a>";
}
if (setting_fetch('search') == 'yes') {
$links[] = "<a href='" . BASE_URL . "search'>" . __("Search") . "</a>";
}
if (setting_fetch('favourites') == 'yes') {
$links[] = "<a href='" . BASE_URL . "favourites'>" . __("Favourites") . "</a>";
}
if (setting_fetch('lists') == 'yes') {
$links[] = "<a href='" . BASE_URL . "lists'>" . __("Lists") . "</a>";
}
if (setting_fetch('followers') == 'yes') {
$links[] = "<a href='" . BASE_URL . "followers'>" . __("Followers") . "</a>";
}
if (setting_fetch('friends') == 'yes') {
$links[] = "<a href='" . BASE_URL . "friends'>" . __("Friends") . "</a>";
}
if (setting_fetch('blockings') == 'yes') {
$links[] = "<a href='" . BASE_URL . "blockings'>" . __("Blockings") . "</a>";
}
}
if (user_is_authenticated()) {
$user = user_current_username();
array_unshift($links, "<b><a href='" . BASE_URL . "user/{$user}'>{$user}</a></b>");
if (setting_fetch('about') == 'yes') {
$links[] = "<a href='" . BASE_URL . "about'>" . __("About") . "</a>";
}
if (setting_fetch('ssettings', 'yes') == 'yes') {
$links[] = "<a href='" . BASE_URL . "settings'>" . __("Settings") . "</a>";
}
if (setting_fetch('slogout') == 'yes') {
$links[] = "<a href='" . BASE_URL . "logout'>" . __("Logout") . "</a>";
}
}
if (setting_fetch('srefresh', 'yes') == 'yes') {
$links[] = "<a href='" . BASE_URL . "{$_GET['q']}' accesskey='5'>" . __("Refresh") . "</a> 5";
}
return "<div class='menu menu-{$menu}'>" . implode(' | ', $links) . "</div>" . theme('pagination');
}
开发者ID:noviachen,项目名称:netputweets,代码行数:51,代码来源:blackberry.php
示例11: twitter_lists_tweets
function twitter_lists_tweets($user, $list)
{
// Tweets belonging to a list
$count = setting_fetch('ltpp', 20);
// https://dev.twitter.com/docs/api/1/get/lists/statuses
// How many tweets to show
$perPage = setting_fetch('perPage', 20);
$url = API_URL . "lists/statuses.json?slug={$list}&owner_screen_name={$user}&per_page={$perPage}&include_entities=true&include_rts=true";
$page = intval($_GET['page']);
if ($page > 0) {
$url .= '&page=' . $page;
}
$url .= '&per_page=' . $count;
return twitter_process($url);
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:15,代码来源:lists.php
示例12: twitter_lists_list_subscribers
function twitter_lists_list_subscribers($user, $list)
{
// Subscribers of a list
$api_options = array("owner_screen_name" => $user, "slug" => $list);
$api_options["count"] = setting_fetch('dabr_perPage', 20);
$cursor = $_GET['cursor'];
if (!is_numeric($cursor)) {
$cursor = -1;
}
if ($cursor > 0) {
$api_options["cursor"] = $cursor;
}
$list = execute_codebird("lists_subscribers", $api_options);
return $list;
}
开发者ID:vinazol,项目名称:Dabr,代码行数:15,代码来源:lists.php
示例13: browser_detect
function browser_detect()
{
if ($browser = setting_fetch('browser')) {
return browser_load($browser);
}
if ($_SERVER['HTTP_X_NOKIA_BEARER'] == 'GPRS') {
return browser_load('text');
}
if (array_key_exists('HTTP_X_DEVICE_USER_AGENT', $_SERVER)) {
$user_agent = $_SERVER['HTTP_X_DEVICE_USER_AGENT'];
} else {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
}
$handle = fopen('browsers/list.csv', 'r');
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
if (preg_match("#{$data[0]}#", $user_agent, $matches)) {
browser_load($data[1]);
break;
}
}
fclose($handle);
}
开发者ID:novasarii,项目名称:dabr,代码行数:22,代码来源:browser.php
示例14: theme_menu_bottom
function theme_menu_bottom()
{
$links = array();
$links[] = "<a href='" . BASE_URL . "'>" . __("Home") . "</a>";
if (user_is_authenticated()) {
if (setting_fetch('replies') == 'yes') {
$links[] = "<a href='" . BASE_URL . "replies'>" . __("Replies") . "</a>";
}
if (setting_fetch('retweets') == 'yes') {
$links[] = "<a href='" . BASE_URL . "retweets'>" . __("Retweets") . "</a>";
}
if (setting_fetch('directs') == 'yes') {
$links[] = "<a href='" . BASE_URL . "directs'>" . __("Directs") . "</a>";
}
if (setting_fetch('search') == 'yes') {
$links[] = "<a href='" . BASE_URL . "search'>" . __("Search") . "</a>";
}
if (setting_fetch('favourites') == 'yes') {
$links[] = "<a href='" . BASE_URL . "favourites'>" . __("Favourites") . "</a>";
}
if (setting_fetch('lists') == 'yes') {
$links[] = "<a href='" . BASE_URL . "lists'>" . __("Lists") . "</a>";
}
if (setting_fetch('followers') == 'yes') {
$links[] = "<a href='" . BASE_URL . "followers'>" . __("Followers") . "</a>";
}
if (setting_fetch('friends') == 'yes') {
$links[] = "<a href='" . BASE_URL . "friends'>" . __("Friends") . "</a>";
}
if (setting_fetch('blockings') == 'yes') {
$links[] = "<a href='" . BASE_URL . "blockings'>" . __("Blockings") . "</a>";
}
}
if (user_is_authenticated()) {
$user = user_current_username();
array_unshift($links, "<b><a href='" . BASE_URL . "user/{$user}'>{$user}</a></b>");
if (setting_fetch('about') == 'yes') {
$links[] = "<a href='" . BASE_URL . "about'>" . __("About") . "</a>";
}
if (setting_fetch('ssettings', 'yes') == 'yes') {
$links[] = "<a href='" . BASE_URL . "settings'>" . __("Settings") . "</a>";
}
if (setting_fetch('slogout', 'yes') == 'yes') {
$links[] = "<a href='" . BASE_URL . "logout'>" . __("Logout") . "</a>";
}
}
return '<div class="menu menu-$menu">' . implode(' | ', $links) . '</div>';
}
开发者ID:noviachen,项目名称:netputweets,代码行数:48,代码来源:menu.php
示例15: replacementURLs
function replacementURLs($matches)
{
$replacement = $matches[2];
$url = $matches[3];
if (!preg_match("#^https{0,1}://#i", $url)) {
$url = "http://{$url}";
}
if (setting_fetch('gwt') == 'on') {
$encoded = urlencode($url);
$replacement .= "<a href='http://google.com/gwt/n?u={$encoded}' target='_blank'>{$url}</a>";
} else {
$replacement .= theme('external_link', $url);
}
return $replacement;
}
开发者ID:hnprashanth,项目名称:dabr-installer,代码行数:15,代码来源:twitter.php
示例16: theme_css
function theme_css()
{
$c = theme('colours');
$out = "<style type='text/css'>a{color:#{$c->links};}form{margin:.3em;}img{border:0;}small,small a{color:#{$c->small};font-weight:normal;}body{background:#{$c->bodybg};color:#{$c->bodyt};margin:0;font:90% sans-serif;}.odd{background:#{$c->odd};}.even{background:#{$c->even};}.reply{background:#{$c->replyodd};}.reply.even{background:#{$c->replyeven};}.menu{color:#{$c->menut};background:#{$c->menubg};padding:2px;}.menu a{color:#{$c->menua};text-decoration:none;}.profile,.tweet{padding:5px;}.stext a{font-weight:bold;}.date{padding:5px;font-size:0.75em;color:#{$c->small}}.avatar{display:block;left:0.3em;margin:0;overflow:hidden;position:absolute;}.status{display:block;}.shift{margin-left:30px;min-height:24px;}.shift48{margin-left:60px;min-height:48px;}" . setting_fetch('css') . "</style>";
return $out;
}
开发者ID:noviachen,项目名称:netputweets,代码行数:6,代码来源:theme.php
示例17: theme_action_icons
function theme_action_icons($status)
{
$from = $status->from->screen_name;
$retweeted_by = $status->retweeted_by->user->screen_name;
$retweeted_id = $status->retweeted_by->id;
$geo = $status->geo;
$actions = array();
if (!$status->is_direct) {
if (setting_fetch('buttonrl', 'yes') == 'yes' && setting_fetch('rl_user', '') !== '' && setting_fetch('rl_pass', '') !== '') {
$actions[] = theme('action_icon', "status/{$status->id}/rl", 'images/instapaper.png', 'RL');
}
if (setting_fetch('buttonre', 'yes') == 'yes') {
$actions[] = theme('action_icon', "user/{$from}/reply/{$status->id}", 'images/reply.png', 'AT');
}
}
//Reply All functionality.
if (setting_fetch('buttonreall') == 'yes' && $status->entities->user_mentions) {
$actions[] = theme('action_icon', "user/{$from}/replyall/{$status->id}", 'images/replyall.png', 'RE');
}
if (setting_fetch('buttondm') == 'yes') {
if (!user_is_current_user($from)) {
$actions[] = theme('action_icon', "directs/create/{$from}", 'images/dm.png', 'DM');
}
}
if (!$status->is_direct) {
if (setting_fetch('buttonfav', 'yes') == 'yes') {
if ($status->favorited == '1') {
$actions[] = theme('action_icon', "unfavourite/{$status->id}", 'images/star.png', 'UNFAV');
} else {
$actions[] = theme('action_icon', "favourite/{$status->id}", 'images/star_grey.png', 'FAV');
}
}
if (setting_fetch('buttonrt', 'yes') == 'yes') {
if ($retweeted_by) {
$actions[] = theme('action_icon', "retweet/{$status->id}", 'images/retweeted.png', 'RTED');
} else {
$actions[] = theme('action_icon', "retweet/{$status->id}", 'images/retweet.png', 'RT');
}
}
if (setting_fetch('buttondel', 'yes') == 'yes') {
if (user_is_current_user($from)) {
$actions[] = theme('action_icon', "confirm/delete/{$status->id}", 'images/trash.gif', 'DEL');
}
if ($retweeted_by) {
if (user_is_current_user($retweeted_by)) {
$actions[] = theme('action_icon', "confirm/delete/{$retweeted_id}", 'images/trash.gif', 'DEL');
}
}
}
} else {
if (setting_fetch('buttondel', 'yes') == 'yes') {
$actions[] = theme('action_icon', "confirm/deleteDM/{$status->id}", 'images/trash.gif', 'DEL');
}
}
if (setting_fetch('buttonmap', 'yes') == 'yes') {
if ($geo !== null) {
$latlong = $geo->coordinates;
$lat = $latlong[0];
$long = $latlong[1];
$actions[] = theme('action_icon', "https://maps.google.com/maps?q={$lat},{$long}", 'images/map.png', 'MAP');
}
}
if (setting_fetch('buttonot', 'yes') == 'yes') {
$actions[] = theme('action_icon', "http://twitter.com/{$from}/status/{$status->id}", 'images/original.png', 'OT');
}
if (setting_fetch('buttonsearch', 'yes') == 'yes') {
//Search for @ to a user
$actions[] = theme('action_icon', "search?query=%40{$from}", 'images/q.png', '?');
}
return implode(' ', $actions);
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:71,代码来源:twitter.php
示例18: desktop_theme_status_form
function desktop_theme_status_form($text = '', $in_reply_to_id = NULL)
{
if (user_is_authenticated()) {
$fixedtagspre = setting_fetch('fixedtagspre');
$fixedtagspost = setting_fetch('fixedtagspost');
$fixedtagspre = !empty($fixedtagspre) && setting_fetch('fixedtagspreo', 'no') == "yes" && $text == '' ? $fixedtagspre . " " : NULL;
$fixedtagspost = !empty($fixedtagspost) && setting_fetch('fixedtagsposto', 'no') == "yes" && $text == '' ? " " . $fixedtagspost : NULL;
$text = $fixedtagspre . $text . $fixedtagspost;
// adding ?status=foo will automaticall add "foo" to the text area.
if ($_GET['status']) {
$text = $_GET['status'];
}
$output = '<form method="post" action="update">
<fieldset><legend>What\'s Happening?</legend>
<div><textarea id="status" name="status" rows="4" cols="60">' . $text . '</textarea>
';
if (setting_fetch('buttongeo') == 'yes') {
$output .= '<br /><span id="geo" style="display: inline;"><input onclick="goGeo()" type="checkbox" id="geoloc" name="location" /> <label for="geoloc" id="lblGeo"></label></span>
<script type="text/javascript">
<!--
started = false;
chkbox = document.getElementById("geoloc");
if (navigator.geolocation) {
geoStatus("Tweet my location");
if ("' . $_COOKIE['geo'] . '"=="Y") {
chkbox.checked = true;
goGeo();
}
}
function goGeo(node) {
if (started) return;
started = true;
geoStatus("Locating...");
navigator.geolocation.getCurrentPosition(geoSuccess, geoStatus, {enableHighAccuracy: true});
}
function geoStatus(msg) {
document.getElementById("geo").style.display = "inline";
document.getElementById("lblGeo").innerHTML = msg;
}
function geoSuccess(position) {
if(typeof position.address !== "undefined")
geoStatus("Tweet my <a href=\'https://maps.google.com/maps?q=loc:" + position.coords.latitude + "," + position.coords.longitude + "\' target=\'blank\'>location</a>" + " (" + position.address.country + position.address.region + "省" + position.address.city + "市,accuracy: " + position.coords.accuracy + "m)");
else
geoStatus("Tweet my <a href=\'https://maps.google.com/maps?q=loc:" + position.coords.latitude + "," + position.coords.longitude + "\' target=\'blank\'>location</a>" + " (accuracy: " + position.coords.accuracy + "m)");
chkbox.value = position.coords.latitude + "," + position.coords.longitude;
}
//-->
</script>
';
}
$output .= '<div><input name="in_reply_to_id" value="' . $in_reply_to_id . '" type="hidden" /><button id="submit" type="submit">Tweet</button><span id="remaining">140</span>';
$output .= '</div></div></fieldset></form>';
$output .= js_counter('status');
if (setting_fetch('browser') == 'desktop') {
$output .= '<script type="text/javascript">
<!--
document.getElementById("status").onkeydown=function(b){var a=null;a=window.event?window.event:b;a!=null&&a.ctrlKey&&a.keyCode==13&&document.getElementById("submit").click()};
//-->
</script>';
}
return $output;
}
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:63,代码来源:desktop.php
示例19: theme_colours
function theme_colours()
{
$info = $GLOBALS['colour_schemes'][setting_fetch('colours', 5)];
list($name, $bits) = explode('|', $info);
$colours = explode(',', $bits);
return (object) array('links' => $colours[0], 'bodybg' => $colours[1], 'bodyt' => $colours[2], 'small' => $colours[3], 'odd' => $colours[4], 'even' => $colours[5], 'replyodd' => $colours[6], 'replyeven' => $colours[7], 'menubg' => $colours[8], 'menut' => $colours[9], 'menua' => $colours[10]);
}
开发者ID:novasarii,项目名称:dabr,代码行数:7,代码来源:theme.php
示例20: theme_css
function theme_css()
{
$c = theme('colours');
$t = "<style type='text/css'>\r\na{color:#{$c->links};}table{border-collapse:collapse;}\r\nform{margin:.3em;}td{vertical-align:top;padding:0.3em;}\r\nimg{border:0;}\r\nbody{background:#{$c->bodybg};color:#{$c->bodyt};margin:0;font:90% sans-serif;}\r\n.odd{background:#{$c->odd}}\r\n.even{background:#{$c->even}}\r\n.reply{background:#{$c->replyodd}}\r\n.reply.even{background: #{$c->replyeven}}\r\n.menu{color:#{$c->menut};background:#{$c->menubg};padding: 2px;}\r\n.menu a{color:#{$c->menua};text-decoration: none;}\r\n.tweet,.features{padding:5px}\r\n.date{padding:5px;font-size:0.8em;font-weight:bold;color:#{$c->small}}\r\n.about,.time{font-size:0.75em;color:#{$c->small}}\r\n.avatar{display:block; height:26px; width:26px; left:0.3em; margin:0; overflow:hidden; position:absolute;}\r\n.status{display:block;word-wrap:break-word;}\r\n.list span{margin:0 4px 0 0;}";
if (setting_fetch('avataro', 'yes') !== 'yes') {
$t .= ".shift{margin-left:30px;min-height:24px;}";
} else {
$t .= ".shift{margin-left:10px;min-height:24px;}";
}
$t .= ".from{font-size:0.75em;color:#{$c->small};font-family:serif;}\r\n.from a{color:#{$c->small};}\r\n.textb{font-weight:bold;}\r\n.texts,.texts a{color:#{$c->small};font-size:small;}\r\ntextarea{width:90%; max-width: 400px;overflow-x:hidden;}\r\n.translate{padding:5px;margin:15px;border:thin solid;}\r\ninput#query{width:100%;max-width:300px;}\r\n#about{margin:0.5em;padding:0.1em 1em;}\r\nfieldset{border:1px dashed #{$c->bodyt};}\r\nhr{border:1px dotted#{$c->bodyt};}\r\n.filter{text-decoration:none;}\r\n.sinput{width:40px;}\r\n.linput{width:120px;}\r\n.minput{width:20px;}\r\n.ninput{width:90px;}\r\n</style>";
return $t;
}
开发者ID:JaHIY,项目名称:Netputweets-Lite,代码行数:12,代码来源:theme.php
注:本文中的setting_fetch函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论