예제 #1
0
 public function index()
 {
     //$sitemap = new google_sitemap; //Create a new Sitemap Object
     $posts = $this->cf_blog_model->getRecentPosts('50');
     $item = $this->cf_sitemap_lib->google_sitemap_item(site_url(), date("Y-m-d", time()), 'daily', '1.0');
     //Create a new Item
     $this->cf_sitemap_lib->add_item($item);
     foreach ($posts->result_array() as $entry) {
         $link = get_page_url($entry);
         //Create a new Item
         $item = $this->cf_sitemap_lib->google_sitemap_item(site_url($link), date("Y-m-d", strtotime($entry['page_date'])), 'daily', '0.5');
         //Append the item to the sitemap object
         $this->cf_sitemap_lib->add_item($item);
     }
     $this->cf_sitemap_lib->build("sitemap.xml");
     //Build it...
     //Let's compress it to gz
     $data = implode("", file("sitemap.xml"));
     $gzdata = gzencode($data, 9);
     $fp = fopen("sitemap.xml.gz", "w");
     fwrite($fp, $gzdata);
     fclose($fp);
     //Let's Ping google
     $this->_pingGoogleSitemaps(base_url() . "/sitemap.xml.gz");
     echo site_url();
 }
예제 #2
0
function return_disqus()
{
    global $disqus_conf;
    $new_content = '<div id="disqus_thread"></div>';
    $new_content .= '<script type="text/javascript">';
    $new_content .= "var disqus_shortname = '" . $disqus_conf['shortname'] . "';";
    $new_content .= "var disqus_developer = '" . $disqus_conf['developer'] . "';";
    $new_content .= "var disqus_identifier = '" . return_page_slug() . "';";
    $new_content .= "var disqus_url = '" . get_page_url(True) . "';";
    $new_content .= "var disqus_title = '" . return_page_title() . "';";
    $new_content .= <<<INLINECODE
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
INLINECODE;
    return $new_content;
}
예제 #3
0
파일: main.php 프로젝트: KingNoosh/Teknik
echo $CONF['template'];
?>
/img/screenshots/paste_screenshot.PNG" title="Apple" data-gallery>
              <img src="<?php 
echo get_page_url("cdn", $CONF);
?>
/<?php 
echo $CONF['template'];
?>
/img/screenshots/paste_screenshot_thumb.png" alt="Apple">
          </a>
          <a href="<?php 
echo get_page_url("cdn", $CONF);
?>
/<?php 
echo $CONF['template'];
?>
/img/screenshots/podcast_screenshot.PNG" title="Orange" data-gallery>
              <img src="<?php 
echo get_page_url("cdn", $CONF);
?>
/<?php 
echo $CONF['template'];
?>
/img/screenshots/podcast_screenshot_thumb.png" alt="Orange">
          </a>
      </div>
    </div>
  </div>
</div>
예제 #4
0
        // the allowed login attempt limits (see functions.php for more):
        rate_limit($_SERVER['REMOTE_ADDR']);
        // Record this login attempt
        rate_limit_tick($_SERVER['REMOTE_ADDR'], $_POST['email']);
        // Send the message to the user
        $message = '';
        $email = $_POST['email'];
        $subject = 'Your Login Link';
        if (!User::exists($email)) {
            $subject = "Thank You For Registering!";
            $message = "Thank you for registering at our site!\n\n";
        }
        // Attempt to login or register the person
        $user = User::loginOrRegister($_POST['email']);
        $message .= "You can login from this URL:\n";
        $message .= get_page_url() . "?tkn=" . $user->generateToken() . "\n\n";
        $message .= "The link is going expire automatically after 10 minutes.";
        $result = send_email($fromEmail, $_POST['email'], $subject, $message);
        if (!$result) {
            throw new Exception("There was an error sending your email. Please try again.");
        }
        die(json_encode(array('message' => 'Thank you! We\'ve sent a link to your inbox. Check your spam folder as well.')));
    }
} catch (Exception $e) {
    die(json_encode(array('error' => 1, 'message' => $e->getMessage())));
}
/*--------------------------------------------------
	Output the login form
---------------------------------------------------*/
?>
<!DOCTYPE HTML>
예제 #5
0
파일: main.php 프로젝트: KingNoosh/Teknik
/<?php 
    echo $post_id;
    ?>
" id="title_<?php 
    echo $post_id;
    ?>
"><?php 
    echo $title;
    ?>
</a></h2>
                      <p class="blog-post-meta-sm text-left text-muted">
                        Posted on <?php 
    echo date("F d, Y", strtotime($date));
    ?>
 by <a href="<?php 
    echo get_page_url("home", $CONF);
    ?>
/<?php 
    echo $author->username;
    ?>
"><?php 
    echo $author->username;
    ?>
</a>
                      </p>
                    </div>
                  </div>
                </div>
              </li>
            <?php 
}
예제 #6
0
파일: index.php 프로젝트: KingNoosh/Teknik
                    $user_id = $pod['user_id'];
                    $date = $pod['date_posted'];
                    $title = rawurldecode($pod['title']);
                    $tags = $pod['tags'];
                    $file = $pod['file_name'];
                    $files = explode(',', $file);
                    $Parsedown = new Parsedown();
                    $post = $Parsedown->text($pod['description']);
                    $rssfeed .= '<item>';
                    $rssfeed .= '<title><![CDATA[' . $title . ']]></title>';
                    $rssfeed .= '<description><![CDATA[' . $post . ']]></description>';
                    foreach ($files as $filename) {
                        $file_path = get_page_url("podcast", $CONF) . '/Podcasts/' . $title . '/' . $filename;
                        $direct_path = $CONF['podcast_dir'] . $title . '/' . $filename;
                        $file_type = mime_content_type($direct_path);
                        $file_length = filesize($direct_path);
                        $rssfeed .= '<enclosure url="' . $file_path . '" length="' . $file_length . '" type="' . $file_type . '" />';
                    }
                    $rssfeed .= '<link>' . get_page_url("podcast", $CONF) . '/' . $post_id . '</link>';
                    $rssfeed .= '<pubDate>' . date("D, d M Y H:i:s O", strtotime($date)) . '</pubDate>';
                    $rssfeed .= '</item>';
                }
            }
            break;
        default:
            break;
    }
    $rssfeed .= '</channel>';
    $rssfeed .= '</rss>';
    echo $rssfeed;
}
예제 #7
0
                        <div class="box_top_mid">
                            <div class="box_bottom_left">
                                <div class="box_bottom_right">
                                    <div class="box_top_left">
                                        <div class="box_top_right">
                                            <div class="box_content">
                                                <h2><?php 
echo __('Top 10 Page');
?>
</h2>
                                                <?php 
if (isset($top_page)) {
    echo '<ul>';
    foreach ($top_page as $v) {
        echo '<li>';
        echo '<a href="' . get_page_url($v) . '" target="_blank">' . $v['page_title'] . '</a>';
        echo '</li>';
    }
    echo '</ul>';
}
?>
                                                <p class="clear">&nbsp;</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
예제 #8
0
        Хост базы данных
        <input  name="db-host" value="localhost" required>
      </label>
      <label>
        Пользователь базы данных
        <input name="db-user" value="root" required>
      </label>
      <label>
        Пароль базы данных
        <input name="db-pass" value="">
      </label>
      <label>
        Имя базы данных
        <input name="db-name" value="chiffon" required>
      </label>
      <label>
        Путь приложения
        <input name="app-url" value="<?php 
    echo get_page_url();
    ?>
" required>
      </label>
      <button>Установка</button>
    </form>

  <?php 
}
?>

</body>
</html>
예제 #9
0
        //https://itunes.apple.com/us/app/tic-tac-toe/id289278457?mt=8
        $reg_tag = '/\\/id(\\d*)\\?/';
        $ret = preg_match_all($reg_tag, $url, $match_result);
        @($app_ids[$match_result[1][0]] += 1);
    }
}
$category_id = array(6018, 6000, 6022, 6017, 6016, 6015, 6023, 6014, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 6013, 6012, 6020, 6011, 6010, 6009, 6021, 13007, 13006, 13008, 13009, 13010, 13011, 13012, 13013, 13014, 13015, 13002, 13017, 13018, 13003, 13019, 13020, 13021, 13001, 13004, 13023, 13024, 13025, 13026, 13027, 13005, 13028, 13029, 13030, 6008, 6007, 6006, 6005, 6004, 6003, 6002, 6001);
$letters = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '*');
$old = '';
//判断第一个运用,确定是否没有更多分页了。
foreach ($category_id as $cat_id) {
    foreach ($letters as $letter) {
        for ($i = 1; $i < 500; $i++) {
            $url = "https://itunes.apple.com/us/genre/ios-games/id{$cat_id}?letter={$letter}&page={$i}";
            $page_content = get_site_content($url);
            $urls = get_page_url($page_content);
            if ($old == $urls[0]) {
                break;
            } else {
                $old = $urls[0];
            }
            get_and_save_app_id($urls);
            //提取应用ID并保存
            //信息显示
            echo $url . "\n";
        }
        file_put_contents('app_ids.php', '<?php $app_ids = ' . var_export($app_ids, TRUE) . ';');
        echo 'App total: ' . count($app_ids) . "\n";
    }
}
file_put_contents('app_ids.php', '<?php $app_ids = ' . var_export($app_ids, TRUE) . ';');
예제 #10
0
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <*****@*****.**>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$curr_page_id = Application::Get('system_page') == '' ? Application::Get('page_id') : Application::Get('system_page');
$field_name = Application::Get('system_page') == '' ? 'id' : 'system_page';
$mg_language_id = isset($_REQUEST['mg_language_id']) ? prepare_input($_REQUEST['mg_language_id']) : Application::Get('lang');
$new_page_id = Pages::GetPageId($curr_page_id, $mg_language_id, $field_name);
$field_from = Application::Get('system_page') == '' ? 'pid=' . $curr_page_id : 'system_page=' . $curr_page_id;
$field_to = Application::Get('system_page') == '' ? 'pid=' . $new_page_id : 'system_page=' . $new_page_id;
$seo_field_from = Application::Get('system_page') == '' ? '/' . $curr_page_id . '/' : '/' . $curr_page_id . '.';
$seo_field_to = Application::Get('system_page') == '' ? '/' . $new_page_id . '/' : '/' . $new_page_id . '.';
if (!empty($new_page_id) && $curr_page_id != $new_page_id) {
    $url = get_page_url(false);
    if ($objSettings->GetParameter('seo_urls') == '1') {
        $url = str_replace($seo_field_from, $seo_field_to, $url);
    } else {
        $url = str_replace($field_from, $field_to, $url);
    }
    header('location: ' . $url);
    exit;
} else {
    if (empty($new_page_id)) {
        $objSession->SetMessage('notice', draw_important_message(_PAGE_UNKNOWN, false));
    }
}
예제 #11
0
파일: main.php 프로젝트: KingNoosh/Teknik
    this.on("success", function(file, responseText) {
      obj = JSON.parse(responseText);
      var name = obj.results.file.name;
      var short_name = file.name.split(".")[0].hashCode();
      $("#upload-links").css('display', 'inline', 'important');
      $("#upload-links").prepend(' \
        <div class="row link_'+short_name+'"> \
          <div class="col-sm-6"> \
            '+file.name+' \
          </div> \
          <div class="col-sm-3"> \
            <a href="<?php 
echo get_page_url('u', $CONF);
?>
/'+name+'" target="_blank" class="alert-link"><?php 
echo get_page_url('u', $CONF);
?>
/'+name+'</a> \
          </div> \
          <div class="col-sm-3"> \
            <button type="button" class="btn btn-default btn-xs generate-delete-link-'+short_name+'" id="'+name+'">Generate Deletion URL</button> \
          </div> \
        </div> \
      ');
      linkUploadDelete('.generate-delete-link-'+short_name+'');
    });
    this.on("removedfile", function(file) {
      var name = file.name.split(".")[0].hashCode();
      $('.link_'+name).remove();
    });
    this.on("reset", function(file, responseText) {
예제 #12
0
파일: main.php 프로젝트: KingNoosh/Teknik
        </p>
        <p>
          If you would like to request additional information about Teknik, please feel free to contact us through our <a href="<?php 
echo get_page_url("contact", $CONF);
?>
" target="_blank">Contact Form</a> or by emailing us at <a href="mailto:support@<?php 
echo $CONF['host'];
?>
">support@<?php 
echo $CONF['host'];
?>
</a>.
        </p>
        <p>
          Want to make a donation?  Visit our <a href="<?php 
echo get_page_url("about", $CONF);
?>
" target="_blank">About Page</a> and choose a donation method at the bottom.
        </p>
        <br />
      <h2 class="text-center"><b>Statistics</b></h2>
        <hr>
        <div class="row">
          <div class="col-sm-6">
            <h3>Uploads</h3>
              <p>Number of Uploads: <?php 
echo count($upload_list);
?>
</p>
              <p>Total Size: <?php 
echo bytesToSize($total_size['TotalSize']);
예제 #13
0
파일: main.php 프로젝트: KingNoosh/Teknik
      <div class="col-sm-12 blog-heading">
        <h1 class="blog-title text-center"><?php 
    echo $blog_title;
    ?>
</h1>
        <p class="lead blog-description text-center text-muted"><?php 
    echo $blog_desc;
    ?>
</p>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-12 text-center">
        <p>
          <a href="<?php 
    echo get_page_url('rss', $CONF) . '/blog/' . $blog_author;
    ?>
"><i class="fa fa-rss fa-2x fa-border"></i></a>
        </p>
      </div>
    </div>
  <?php 
}
if ($own_blog) {
    ?>
  <div class="row">
    <div class="col-sm-12 text-center">
      <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newPost">Create Post</button>
    </div>
  </div>
  <div class="modal fade" id="newPost" tabindex="-1" role="dialog" aria-labelledby="newPostLabel" aria-hidden="true">
예제 #14
0
echo $template->page_title;
?>
</h1>
	</div>
	
	<div id="innolunch">
		
		<?php 
echo get_var('menu') == 'edit' ? '<form class="form-horizontal" method="post" action="' . get_page_url() . '">' : '';
?>
		
		<h4>Week of <?php 
echo get_var('menu') == 'edit' ? '<input name="innolunch_week" type="text" value="' . Innolunch::getWeek() . '" />' : Innolunch::getWeek();
?>
 <span class="pull-right"><?php 
echo get_var('menu') == 'edit' ? '<a class="btn btn-default btn-xs" href="' . $options['site_url'] . '/index.php?p=zeelunch#innolunch">Cancel</a> <button class="btn btn-primary btn-xs" type="submit" name="save">Save</button>' : '<a href="' . get_page_url() . '&menu=edit#innolunch">Edit</a>';
?>
</span></h4>
		
		<table class="table table-bordered table-hover">
			<thead>
				<tr>
					<th>Day</th>
					<th>Item</th>
					<th>Price</th>
				</tr>
			</thead>
			<tbody>
				<?php 
foreach (Innolunch::getMenu() as $menu) {
    ?>
예제 #15
0
파일: common.php 프로젝트: KingNoosh/Teknik
function upload($files, $CONF, $db)
{
    if (!empty($files)) {
        $filesize = filesize($files['file']['tmp_name']);
        $file_type = mime_content_type($files['file']['tmp_name']);
        $ext = pathinfo($files['file']['name'], PATHINFO_EXTENSION);
        if ($logged_in == 1) {
            $user_id = $user->id;
        } else {
            $user_id = 0;
        }
        if ($filesize <= pow(1024, 2) * $CONF['max_upload_size']) {
            $iv = rand_string(32);
            $targetFile = upload_file($files, $CONF['upload_dir'], $CONF['key'], $iv, $CONF['cipher']);
            $file_used = true;
            while ($file_used) {
                $randomString = rand_string(6);
                if (empty($ext)) {
                    $fileURL = $randomString;
                } else {
                    $fileURL = $randomString . "." . $ext;
                }
                $result = $db->select("uploads", "url=?", array($fileURL));
                if (!$result) {
                    $file_used = false;
                }
            }
            $data = array("filename" => $targetFile, "url" => $fileURL, "type" => $file_type, "user_id" => $user_id, "upload_date" => date("Y-m-d H:i:s", time()), "filesize" => $filesize, "hash" => $iv, "cipher" => $CONF['cipher']);
            $db->insert($data, 'uploads');
            $_SESSION[$fileURL] = $fileURL;
            return array('results' => array('file' => array('name' => $fileURL, 'url' => get_page_url("u", $CONF) . '/' . $fileURL, 'type' => $file_type, 'size' => $filesize)));
        }
        return array('error' => $CONF['errors']['InvFile']);
    }
    return array('error' => $CONF['errors']['NoFile']);
}
예제 #16
0
/**
 * Get Page Header HTML
 *
 * This will return header html for a particular page. This will include the 
 * meta desriptions & keywords, canonical and title tags
 *
 * @since 1.0
 * @uses exec_action
 * @uses get_page_url
 * @uses strip_quotes
 * @uses get_page_meta_desc
 * @uses get_page_meta_keywords
 * @uses $metad
 * @uses $title
 * @uses $content
 * @uses $site_full_name from configuration.php
 * @uses GSADMININCPATH
 *
 * @return string HTML for template header
 */
function get_header($full = true)
{
    global $metad;
    global $title;
    global $content;
    include GSADMININCPATH . 'configuration.php';
    // meta description
    if ($metad != '') {
        $description = get_page_meta_desc(FALSE);
    } else {
        if (getDef('GSAUTOMETAD', true)) {
            // get meta from content excerpt
            if (function_exists('mb_substr')) {
                $description = trim(mb_substr(strip_tags(strip_decode($content)), 0, 160));
            } else {
                $description = trim(substr(strip_tags(strip_decode($content)), 0, 160));
            }
            $description = str_replace('"', '', $description);
            $description = str_replace("'", '', $description);
            $description = preg_replace('/\\n/', " ", $description);
            $description = preg_replace('/\\r/', " ", $description);
            $description = preg_replace('/\\t/', " ", $description);
            $description = preg_replace('/ +/', " ", $description);
        }
    }
    if (!empty($description)) {
        echo '<meta name="description" content="' . $description . '" />' . "\n";
    }
    // meta keywords
    $keywords = get_page_meta_keywords(FALSE);
    if ($keywords != '') {
        echo '<meta name="keywords" content="' . $keywords . '" />' . "\n";
    }
    if ($full) {
        echo '<link rel="canonical" href="' . get_page_url(true) . '" />' . "\n";
    }
    // script queue
    get_scripts_frontend();
    exec_action('theme-header');
}
예제 #17
0
                <div class="col-sm-12 text-center">
                  <iframe style="border: 0; width: 100%;" src="https://stats.teknik.io/index.php?module=CoreAdminHome&action=optOut&language=en"></iframe>
                </div>
              </div>
            </div>
               <?php 
        }
        ?>
          </div><!--/tab-content-->

        </div><!--/col-9-->
    </div><!--/row-->
  </div>
<?php 
        set_page_title($Profile_User->username . " - Teknik");
    } else {
        set_page_title("Teknik");
        ?>
    <div class="container">
      <div class="row">
        <div class="col-sm-12 text-center">
          <h2>Sorry, but I couldn't find that user.</h2>
        </div>
      </div>
    </div>
  <?php 
    }
} else {
    redirect(get_page_url("home", $CONF));
}
include '../templates/' . $CONF['template'] . '/footer.php';
예제 #18
0
<?php

/**
 * Sitemap Generator, Furasta.Org
 *
 * Generates sitemaps when the /sitemap.xml file is accessed.
 *
 * @author     Conor Mac Aoidh <*****@*****.**>
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 */
require 'define.php';
header('Content-type: text/xml');
$pages = rows('select id,slug,edited,parent from ' . DB_PAGES . ' where display=1');
$_url = SITE_URL;
$sitemap = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset>\n";
foreach ($pages as $page) {
    $url = $page['parent'] == 0 ? $_url . $page['slug'] : $_url . implode('/', array_reverse(explode(',', get_page_url($pages, $page['parent'])))) . '/' . $page['slug'];
    $sitemap .= "\t<url>\n" . "\t\t<loc>" . $url . "</loc>\n" . "\t\t<lastmod>" . $page['edited'] . "</lastmod>\n" . "\t</url>\n";
}
$sitemap .= "</urlset>";
$sitemap = $Plugins->filter('general', 'filter_sitemap', $sitemap);
echo $sitemap;
예제 #19
0
function build_header($full)
{
    include GSADMININCPATH . 'configuration.php';
    $str = '';
    // meta description
    $description = get_page_meta_desc(false);
    if (!empty($description)) {
        $str .= '<meta name="description" content="' . $description . '" />' . "\n";
    }
    // meta robots
    $metarobots = get_page_meta_robots(false);
    if (!empty($metarobots)) {
        $str .= '<meta name="robots" content="' . $metarobots . '" />' . "\n";
    }
    // meta keywords
    $keywords = get_page_meta_keywords(false);
    if (!empty($keywords)) {
        $str .= '<meta name="keywords" content="' . $keywords . '" />' . "\n";
    }
    // canonical link
    if ($full) {
        $canonical = exec_filter('linkcanonical', get_page_url(true));
        // @filter linkcanonical (str) rel canonical link
        if (!empty($canonical)) {
            $str .= '<link rel="canonical" href="' . $canonical . '" />' . "\n";
        }
    }
    // script queue
    $str .= getScripts(GSFRONT);
    $str = exec_filter('theme-header', $str);
    return $str;
}
예제 #20
0
파일: api.php 프로젝트: KingNoosh/Teknik
                             $result_list = array($rankResults);
                             break;
                         }
                         array_push($rank_list, $rank_result);
                     }
                     $result_array = array();
                     // Generate object for each result
                     foreach ($result_list as $result) {
                         $id = $result['id'];
                         $rank = multi_array_search($rank_list, array('id' => $id))[0] + 1;
                         $username = $userTools->get($result['user_id'])->username;
                         $image_src = $result['url'];
                         $date_posted = $result['date_added'];
                         $user_vote = $result['TotalPoints'];
                         $tags = explode(',', $result['tags']);
                         array_push($result_array, array('image' => array('id' => $id, 'url' => get_page_url("ricehalla", $CONF) . '/' . $id, 'image_src' => get_page_url("u", $CONF) . '/' . $image_src, 'rank' => $rank, 'votes' => $user_vote, 'owner' => $username, 'date_posted' => $date_posted, 'tags' => $tags)));
                     }
                     array_push($jsonArray, array('results' => $result_array));
                 } else {
                     array_push($jsonArray, array('error' => $CONF['errors']['NoImages']));
                 }
                 break;
             default:
                 array_push($jsonArray, array('error' => $CONF['errors']['InvRequest']));
                 break;
         }
     } else {
         array_push($jsonArray, array('error' => $CONF['errors']['InvRequest']));
     }
     break;
 default:
예제 #21
0
    /**
     *  Draws FAQ list
     *  	@param $draw
     */
    public static function DrawFaqList($draw = true)
    {
        $output = '';
        $page_url = get_page_url();
        if (Modules::IsModuleInstalled('faq')) {
            if (ModulesSettings::Get('faq', 'is_active') == 'yes') {
                $sql = 'SELECT
						fc.id as category_id,
						fc.name as category_name,
						fci.id as item_id,
						fci.faq_question,
						fci.faq_answer,
						fci.priority_order
					FROM ' . TABLE_FAQ_CATEGORY_ITEMS . ' fci
						INNER JOIN ' . TABLE_FAQ_CATEGORIES . ' fc ON fci.category_id = fc.id
					WHERE
						fc.is_active = 1 AND
						fci.is_active = 1
					ORDER BY
						fc.priority_order ASC,
						fci.priority_order ASC ';
                $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS);
                $count = 1;
                $current_category = '';
                $output .= '<a name="up"></a>';
                $output .= '<div class="faq_questions">';
                for ($i = 0; $i < $result[1]; $i++) {
                    if ($current_category == '') {
                        $current_category = $result[0][$i]['category_name'];
                        $output .= ($i > 0 ? '<br>' : '') . '<h3>' . $current_category . '</h3>';
                    } else {
                        if ($current_category != $result[0][$i]['category_name']) {
                            $current_category = $result[0][$i]['category_name'];
                            $output .= ($i > 0 ? '<br>' : '') . '<h3>' . $current_category . '</h3>';
                        }
                    }
                    $output .= '<span>&nbsp;&#8226;&nbsp;</span><a href="' . $page_url . '#faq_' . $result[0][$i]['category_id'] . '_' . $result[0][$i]['item_id'] . '">' . str_replace('\\', '', $result[0][$i]['faq_question']) . '</a><br>';
                }
                $output .= '</div>';
                $current_category = '';
                $draw_hr = true;
                $count = 1;
                for ($i = 0; $i < $result[1]; $i++) {
                    if ($current_category == '') {
                        $current_category = $result[0][$i]['category_name'];
                        $draw_hr = false;
                        $output .= '<br />' . draw_sub_title_bar($current_category, false);
                    } else {
                        if ($current_category != $result[0][$i]['category_name']) {
                            $current_category = $result[0][$i]['category_name'];
                            $draw_hr = false;
                            $output .= '<br />' . draw_sub_title_bar($current_category, false);
                        } else {
                            $draw_hr = true;
                        }
                    }
                    $output .= '<table width="100%" border="0" cellpadding="1" cellspacing="2">
					' . ($draw_hr ? '<tr align="left" valign="top"><td colspan="2"><hr size="1" style="color:#cccccc" noshade></td></tr>' : '') . '
					<tr>
						<td><a name="faq_' . $result[0][$i]['category_id'] . '_' . $result[0][$i]['item_id'] . '"></a><strong>' . str_replace('\\', '', $result[0][$i]['faq_question']) . '</strong></td>
					</tr>
					<tr>
						<td>' . str_replace('\\', '', $result[0][$i]['faq_answer']) . '</td>
					</tr>
					<tr><td colspan="2" align="' . Application::Get('defined_right') . '"><a href="' . $page_url . '#up">top ^</a></td></tr>                
					</table>';
                }
            }
        }
        if ($draw) {
            echo $output;
        } else {
            return $output;
        }
    }
예제 #22
0
<?php

if (!defined('BASEPATH')) {
    exit(__('No direct script access allowed'));
}
//Get Most Popular Posts
$popular = $this->cf_blog_model->getMostPopular(10);
if (!empty($popular)) {
    ?>
<ul class="most_popular">

    <?php 
    foreach ($popular->result_array() as $v) {
        ?>

    <li><a href="<?php 
        echo site_url(get_page_url($v));
        ?>
"><?php 
        echo $v['page_title'];
        ?>
</a></li>

    <?php 
    }
    ?>

</ul>
<?php 
}
예제 #23
0
파일: mail.php 프로젝트: KingNoosh/Teknik
<div class="row">
  <h2><b>Mail</b></h2>
  <hr>
  <h3>Mail Server Settings</h3>
  <p>
      At registration, each user is given an email address with <b>1 GB</b> of storage space. 
      You can either access your email via the <a href="<?php 
echo get_page_url("mail", $CONF);
?>
" target="_blank">Web Client</a> or by using a client of your choosing with support for IMAP or POP3.
  </p>
  <div class="row">
    <div class="col-md-12">
      <ul class="list-group">
        <li class="list-group-item text-center"><h4>Outlook</h4></li>
        <br />
        <div class="col-sm-6">
          <ul class="list-group">
            <li class="list-group-item text-center">User Information</li>
            <li class="list-group-item">Email Address:<div class="pull-right"><b>[username]@<?php 
echo $CONF['host'];
?>
</b></div></li>
            <li class="list-group-item text-center">Server Information</li>
            <li class="list-group-item">Incoming Server:<div class="pull-right"><b>mail.<?php 
echo $CONF['host'];
?>
</b></div></li>
            <li class="list-group-item">Outgoing Server:<div class="pull-right"><b>mail.<?php 
echo $CONF['host'];
?>
예제 #24
0
    function parseContent($content = array(), $show_blurb = TRUE)
    {
        $_content = array();
        if (isset($content) && is_array($content) && count($content) > 0) {
            foreach ($content as $k => $v) {
                //check access
                $access = Model('data')->is_granted($v['group_id']);
                //Get Author + Date Block
                $author_date = Model('data')->author_date($v['page_author'], $v['page_date'], $v['show_author'], $v['show_date']);
                //Get Tags Block
                $page_tag = Model('data')->page_tag($v['page_tag']);
                //Get Tags Block
                $content_content = Library('parser/bbcode')->parse(Model('data')->page_content($v, $show_blurb));
                //$page_content = $this->phpcolor->color_code($content_content);
                $page_content = $content_content;
                //Get the Year | Month | Day the post was posted
                $_content[$k]['year'] = Model('data')->post_year($v['show_date'], $v['page_date']);
                $_content[$k]['month'] = Model('data')->post_month($v['show_date'], $v['page_date']);
                $_content[$k]['day'] = Model('data')->post_day($v['show_date'], $v['page_date']);
                //check to see if there is a form
                if (preg_match_all('#{{form (.+)}}#isU', $page_content, $identifier)) {
                    $form = Library('form')->create($identifier, current_url());
                    if (isset($_POST['identifier'])) {
                        $page_content .= '<script type="text/javascript">
					jQuery(document).ready(function(){check_form();});

					function check_form() {
						jQuery.post(
								\'form/ajax\',
								{
									';
                        foreach ($_POST as $pk => $pv) {
                            if (!is_array($_POST[$pk])) {
                                $page_content .= "{$pk}:document.getElementById(\"{$pk}\").value, \n";
                            } else {
                                //print_r($_POST);
                                foreach ($_POST[$pk] as $chk_k => $chk_v) {
                                    $page_content .= "'" . $pk . '[' . $chk_k . ']' . "'" . ':document.getElementById("' . $pk . '[' . $chk_k . ']").value, ' . "\n";
                                }
                            }
                        }
                        $page_content .= ' },
								function(data){
									jQuery(\'#message_' . $_POST['identifier'] . '\').html(data);
								}
							);
					}
					</script>';
                    }
                    //replace identifiers with form.
                    foreach ($form as $f) {
                        $page_content = preg_replace('#' . $f['block'] . '#isU', $f['form'], $page_content);
                    }
                }
                //check to see if there is a form
                if (preg_match_all('#{{banner (.+)}}#isU', $page_content, $identifier)) {
                    $page_content = Model('banner')->parse($page_content, $identifier);
                }
                $_content[$k]['categories'] = Model('data')->post_category($v['menu_id'], true);
                //$v['menu_id'] = explode(',',$v['menu_id']);
                //$v['menu_id'] = array_filter($v['menu_id']);
                //$v['menu_id'] = array_shift($v['menu_id']);
                $link = get_page_url($v);
                //Model('data')->link_create(array(0 => 'page', 1 => $v['menu_id'], 3 => $v['page_id'], 4 => Model('data')->link_clean($v['page_title'])));
                //If the user has right to view this content...
                if ($access) {
                    //Show heading of the content, ...
                    $_content[$k]['title'] = $v['page_title'];
                    $_content[$k]['author_date'] = $author_date;
                    $_content[$k]['content'] = $page_content;
                    $_content[$k]['tag'] = $page_tag;
                    //add share button
                    $_content[$k]['addthis'] = '<br /><!-- AddThis Button BEGIN --><div class="addthis_toolbox addthis_default_style "><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=dbashyal"></script><!-- AddThis Button END -->';
                    if (isset($v['allow_comment']) && $v['allow_comment']) {
                        $data['page_id'] = $v['page_id'];
                        $data['link'] = $link;
                        //include($template_path . '/blocks/comment.php');
                        $this->lang->load('comment');
                        $_content[$k]['comment'] = Library('block')->load('comment', false, '.php', true);
                    }
                } else {
                    //Show heading of the content, ...
                    $_content[$k]['title'] = $v['page_title'];
                    $_content[$k]['author_date'] .= $author_date;
                    //... but Display message to login
                    $_content[$k]['content'] .= '<p class="error">You do not have access right to view this part of content, Please login.</p>';
                    $_content[$k]['tag'] .= $page_tag;
                }
                //Count total comment
                $_content[$k]['comment_count'] = Model('data')->post_comment_count($v['page_id']);
            }
        }
        //END: Foreach
        return $_content;
    }
예제 #25
0
    /**
     * Returns currencies dropdown list
     * 		@param $allow_seo_links
     */
    public static function GetCurrenciesDDL($allow_seo_links = true)
    {
        global $objSettings;
        $sel_currency = Application::Get('currency_code');
        $currency = Application::Get('currency');
        $output = '';
        $sql = 'SELECT id, name, symbol, code, rate, decimals, primary_order
				FROM ' . TABLE_CURRENCIES . '
				WHERE is_active = 1';
        if ($result = database_query($sql, DATA_AND_ROWS, ALL_ROWS)) {
            if ($result[1] > 1) {
                $base_url = APPHP_BASE;
                $url = get_page_url();
                // prevent wrong re-loading for some problematic cases
                if (self::$PROJECT == 'HotelSite') {
                    $url = str_replace(array('page=booking_payment'), 'page=booking_checkout', $url);
                    $url = str_replace(array('page=check_availability'), 'page=index', $url);
                } else {
                    if (self::$PROJECT == 'ShoppingCart') {
                        $url = str_replace(array('&act=add', '&act=remove'), '', $url);
                        $url = str_replace(array('page=order_proccess'), 'page=checkout', $url);
                        $url = str_replace(array('page=search'), 'page=index', $url);
                    }
                }
                // trim last character if ? or &
                $url = trim($url, '?&');
                if ($objSettings->GetParameter('seo_urls') == '1' && $allow_seo_links) {
                    // remove lang parameters
                    $url = str_replace('/' . Application::Get('lang') . '/', '/', $url);
                    if (preg_match('/\\/' . Application::Get('currency_code') . '\\//i', $url)) {
                        $url = str_replace('/' . Application::Get('currency_code') . '/', '/__CUR__/', $url);
                    } else {
                        $url = str_replace($base_url, $base_url . '__CUR__/', $url);
                    }
                } else {
                    if (preg_match('/currency=' . Application::Get('currency_code') . '/i', $url)) {
                        $url = str_replace('currency=' . Application::Get('currency_code'), 'currency=__CUR__', $url);
                    } else {
                        $url = $url . (preg_match('/\\?/', $url) ? '&amp;' : '?') . 'currency=__CUR__';
                    }
                }
                $output .= '<select onchange="javascript:appSetNewCurrency(\'' . $url . '\',this.value)" name="currency" class="currency_select">';
                for ($i = 0; $i < $result[1]; $i++) {
                    $output .= '<option value="' . $result[0][$i]['code'] . '" ' . ($sel_currency == $result[0][$i]['code'] ? ' selected="selected"' : '') . '>' . $result[0][$i]['name'] . '</option>';
                }
                $output .= '</select>';
            }
        }
        return $output;
    }
예제 #26
0
파일: main.php 프로젝트: KingNoosh/Teknik
        echo $entry['agefmt'];
        ?>
</small>
            <p class="no-margin"><i class="icon-code"></i>
            <?php 
        if ($mod_rewrite == true) {
            echo '<a href="' . get_page_url('p', $CONF) . '/' . $entry['pid'] . '">' . $entry['title'] . '</a>';
        } else {
            echo '<a href="' . get_page_url('p', $CONF) . '/' . '?paste=' . $entry['pid'] . '">' . $entry['title'] . '</a>';
        }
        ?>
            </p>
          </div>
        <?php 
    }
    ?>
        </div>
      </div>
    </div>
  </div> 
</div>
<?php 
}
?>

<p class="text-center">
  Tools: <a href="<?php 
echo get_page_url('git', $CONF);
?>
/Tools.git/blob/master/Paste/paste.sh">Bash Paste Script</a>
</p>
예제 #27
0
    function parseContent($content = array(), $show_blurb = TRUE)
    {
        $_content = array();
        if (isset($content) && is_array($content) && count($content) > 0) {
            foreach ($content as $k => $v) {
                //check access
                $access = Model('data')->is_granted($v['group_id']);
                //Get Author + Date Block
                $author_date = Model('data')->author_date($v);
                //Get Tags Block
                $page_tag = Model('data')->page_tag($v['page_tag']);
                //Get Tags Block
                $content_content = Library('parser/bbcode')->parse(Model('data')->page_content($v, $show_blurb));
                //$page_content = $this->phpcolor->color_code($content_content);
                $page_content = $content_content;
                //Get the Year | Month | Day the post was posted
                $_content[$k]['year'] = Model('data')->post_year($v['show_date'], $v['page_date']);
                $_content[$k]['month'] = Model('data')->post_month($v['show_date'], $v['page_date']);
                $_content[$k]['day'] = Model('data')->post_day($v['show_date'], $v['page_date']);
                //check to see if there is a form
                if (preg_match_all('#{{form (.+)}}#isU', $page_content, $identifier)) {
                    $form = Library('form')->create($identifier, current_url());
                    if (isset($_POST['identifier'])) {
                        $page_content .= '<script type="text/javascript">
					jQuery(document).ready(function(){check_form();});

					function check_form() {
						jQuery.post(
								\'form/ajax\',
								{
									';
                        foreach ($_POST as $pk => $pv) {
                            if (!is_array($_POST[$pk])) {
                                $page_content .= "{$pk}:document.getElementById(\"{$pk}\").value, \n";
                            } else {
                                //print_r($_POST);
                                foreach ($_POST[$pk] as $chk_k => $chk_v) {
                                    $page_content .= "'" . $pk . '[' . $chk_k . ']' . "'" . ':document.getElementById("' . $pk . '[' . $chk_k . ']").value, ' . "\n";
                                }
                            }
                        }
                        $page_content .= ' },
								function(data){
									jQuery(\'#message_' . $_POST['identifier'] . '\').html(data);
								}
							);
					}
					</script>';
                    }
                    //replace identifiers with form.
                    foreach ($form as $f) {
                        $page_content = preg_replace('#' . $f['block'] . '#isU', $f['form'], $page_content);
                    }
                }
                //check to see if there is a form
                if (preg_match_all('#{{banner (.+)}}#isU', $page_content, $identifier)) {
                    $page_content = Model('banner')->parse($page_content, $identifier);
                }
                $_content[$k]['categories'] = Model('data')->post_category($v['menu_id'], true);
                //$v['menu_id'] = explode(',',$v['menu_id']);
                //$v['menu_id'] = array_filter($v['menu_id']);
                //$v['menu_id'] = array_shift($v['menu_id']);
                $link = get_page_url($v);
                //Model('data')->link_create(array(0 => 'page', 1 => $v['menu_id'], 3 => $v['page_id'], 4 => Model('data')->link_clean($v['page_title'])));
                //If the user has right to view this content...
                if ($access) {
                    //Show heading of the content, ...
                    $_content[$k]['title'] = $v['page_title'];
                    $_content[$k]['title-link'] = anchor($link, $v['page_title']);
                    $_content[$k]['title-url'] = $link;
                    $_content[$k]['author_date'] = $author_date;
                    $_content[$k]['content'] = $page_content;
                    $_content[$k]['tag'] = $page_tag;
                    if ($this->uri->segment(3, 0) == $v['page_id']) {
                        //add share button
                        $_content[$k]['addthis'] = '<br /><!-- AddThis Button BEGIN --><script type="text/javascript">var addthis_pub="dbashyal";</script><a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script><!-- AddThis Button END -->';
                        $_content[$k]['sharethis'] = '
<div class="post_share social-media"><div class="large-buttons"><div class="wdt_button">
<iframe id="tweet_frame_483679" name="tweet_frame_483679" allowtransparency="true" frameborder="0" role="presentation" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=' . urlencode(site_url($link)) . '&amp;via=@codefight&amp;text=' . urlencode($v['page_title']) . '&amp;count=vertical" width="55" height="63"></iframe>
</div><div class="wdt_button wdt_fb"><fb:share-button href="' . site_url($link) . '" type="box_count"></fb:share-button></div><div class="wdt_button">
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5&ampr=' . urlencode(site_url($link)) . '&amp;title=' . urlencode($v['page_title']) . '"></script></div></div><div class="small-buttons" style="display:none"><div class="wdt_button_min">
<iframe id="tweet_frame_483679" name="tweet_frame_483679" allowtransparency="true" frameborder="0" role="presentation" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=' . urlencode(site_url($link)) . '&amp;via=@codefight&amp;text=' . urlencode($v['page_title']) . '&amp;count=horizontal" width="110" height="20"></iframe>
</div><div class="wdt_button_min"><fb:share-button href="' . $link . '" type="button_count"></fb:share-button></div><div class="wdt_button_min">
<script src="http://www.stumbleupon.com/hostedbadge.php?s=1&r=' . urlencode(site_url($link)) . '&amp;title=' . urlencode($v['page_title']) . '"></script></div><div class="wdt_button_min">
<a class="chicklet" id="st_email_min" href="javascript:void(0);">email</a></div><div class="wdt_button_min"
><a class="chicklet" id="st_sharethis_min" href="javascript:void(0);">share</a>
<script type="text/javascript">
var shared_object = SHARETHIS.addEntry({title: "' . $v['page_title'] . '",url: "' . site_url($link) . '"}, {button:false,onmouseover:false});
shared_object.attachButton(document.getElementById(\'st_sharethis_min\'));
shared_object.attachChicklet(\'email\', document.getElementById(\'st_email_min\'));
</script>
</div></div><div class="wdt_button"><a class="chicklet" id="st_email" href="javascript:void(0);">email</a></div><div class="wdt_button">
<a class="chicklet" id="st_sharethis" href="javascript:void(0);">share</a>
<script type="text/javascript">
var shared_object = SHARETHIS.addEntry({title: "' . $v['page_title'] . '",url: "' . site_url($link) . '"}, {button:false,onmouseover:false});
shared_object.attachButton(document.getElementById(\'st_sharethis\'));shared_object.attachChicklet(\'email\', document.getElementById(\'st_email\'));
</script></div></div>';
                        if (isset($v['allow_comment']) && $v['allow_comment']) {
                            $data['page_id'] = $v['page_id'];
                            $data['link'] = $link;
                            //include($template_path . '/blocks/comment.php');
                            $this->lang->load('comment');
                            $_content[$k]['comment'] = Library('block')->load('comment', false, '.php', true);
                        }
                    }
                } else {
                    //Show heading of the content, ...
                    $_content[$k]['title'] = $v['page_title'];
                    $_content[$k]['author_date'] .= $author_date;
                    //... but Display message to login
                    $_content[$k]['content'] .= '<p class="error">You do not have access right to view this part of content, Please login.</p>';
                    $_content[$k]['tag'] .= $page_tag;
                }
                //Count total comment
                $_content[$k]['comment_count'] = Model('data')->post_comment_count($v['page_id']);
            }
        }
        //END: Foreach
        return $_content;
    }
예제 #28
0
파일: frame.php 프로젝트: justin1986/eachbb
function paginate($url = "", $ajax_dom = null, $page_var = "page", $force_show = false, $type = 'normal', $show_type = 1)
{
    global $page_type;
    $pageindextoken = empty($page_var) ? "page" : $page_var;
    $record_count_token = $pageindextoken . "_record_count";
    $pagecounttoken = $pageindextoken . "_page_count";
    global ${$pagecounttoken};
    global ${$record_count_token};
    $pageindex = isset($_REQUEST[$pageindextoken]) ? $_REQUEST[$pageindextoken] : 1;
    $pagecount = isset($_REQUEST[$pagecounttoken]) ? $_REQUEST[$pagecounttoken] : ${$pagecounttoken};
    if ($pagecount <= 1 && !$force_show) {
        return;
    }
    if (empty($url)) {
        $url = $_SERVER['PHP_SELF'] . "?";
    }
    $pagefirst = get_page_url($url, 1, $page_var, $type);
    $pagenext = get_page_url($url, $pageindex + 1, $page_var, $type);
    $pageprev = get_page_url($url, $pageindex - 1, $page_var, $type);
    $pagelast = get_page_url($url, $pagecount, $page_var, $type);
    if ($show_type == 1) {
        if ($pageindex == 1) {
            ?>
		  <span>[首页]</span> 
		  <span>[上页]</span>	
		  <?php 
            if ($pagecount > 1) {
                ?>
		  <span><a class="paginate_link" href="<?php 
                echo $pagenext;
                ?>
">[下页]</a></span> 
		  <span><a class="paginate_link" href="<?php 
                echo $pagelast;
                ?>
">[尾页]</a></span>
		  <?php 
            } else {
                ?>
		  <span>[下页]</span> 
		  <span>[尾页]</span>		  
		<?php 
            }
        }
        if ($pageindex < $pagecount && $pageindex > 1) {
            ?>
		  <span><a class="paginate_link" href="<?php 
            echo $pagefirst;
            ?>
">[首页]</a></span> 
		  <span><a class="paginate_link" href="<?php 
            echo $pageprev;
            ?>
">[上页]</a></span>			
		  <span><a class="paginate_link" href="<?php 
            echo $pagenext;
            ?>
">[下页]</a></span> 
		  <span><a class="paginate_link" href="<?php 
            echo $pagelast;
            ?>
">[尾页]</a></span>		
		 <?php 
        }
        if ($pageindex == $pagecount && $pageindex != 1) {
            ?>
		  <span><a class="paginate_link" href="<?php 
            echo $pagefirst;
            ?>
">[首页]</a></span> 
		  <span><a class="paginate_link" href="<?php 
            echo $pageprev;
            ?>
">[上页]</a></span>
		  <span>[下页]</span> 
		  <span>[尾页]</span>	  		
		<?php 
        }
        ?>
共找到<?php 
        echo ${$record_count_token};
        ?>
条记录 
	  当前第<select name="pageselect" class="pageselect">
		<?php 
        //产生所有页面链接
        for ($i = 1; $i <= $pagecount; $i++) {
            $ourl = get_page_url($url, $i, $page_var, $type);
            ?>
			<option <?php 
            if ($pageindex == $i) {
                echo 'selected="selected"';
            }
            ?>
 value="<?php 
            echo $ourl;
            ?>
" ><?php 
            echo $i;
            ?>
</option>
			<?php 
        }
        ?>
		</select>页 共<?php 
        echo $pagecount;
        ?>
页
		<script>
			$('.pageselect').change(function(){
				var ourl = $(this).val();
				<?php 
        if ($ajax_dom) {
            echo "\$('#{$ajax_dom}').load(ourl)";
        } else {
            echo "window.location.href=ourl;";
        }
        ?>
			}); 
		</script>
		
		<?php 
        if (!empty($ajax_dom)) {
            ?>
			<script>
				$(".paginate_link").click(function(e){
					e.preventDefault();
					$("#<?php 
            echo $ajax_dom;
            ?>
").load($(this).attr('href'));
				});
			</script>
			<?php 
        }
    } else {
        if ($show_type == 2) {
            //文章翻页样式,只有上页 下页 和中间的
            if ($pageindex == 1) {
                echo "<span class='paginate_botton'>上页</span>";
            } else {
                $turl = get_page_url($url, $pageindex - 1, $page_var, $type);
                echo "<span class='paginate_botton'><a href='{$turl}'>上页</a></span>";
            }
            for ($i = 1; $i <= $pagecount; $i++) {
                if ($i == $pageindex) {
                    echo "<span class='page_span2'>{$i}</span>";
                } else {
                    $turl = get_page_url($url, $i, $page_var, $type);
                    echo "<span class='page_span'><a href='{$turl}'>{$i}</a></span>";
                }
            }
            if ($pageindex == $pagecount) {
                echo "<span class='paginate_botton'>下页</span>";
            } else {
                $turl = get_page_url($url, $pageindex + 1, $page_var, $type);
                echo "<span class='paginate_botton'><a href='{$turl}'>下页</a></span>";
            }
        }
    }
}
예제 #29
0
<?php

include '../includes/config.php';
if (isset($_POST) && isset($_SESSION)) {
    $file = rawurldecode($_POST['uploadID']);
    if (isset($_SESSION[$file]) && $_SESSION[$file] == $file) {
        $file_db = $db->select('uploads', "url=? LIMIT 1", array($file));
        if ($file_db) {
            $delete_key = generate_code($file_db['url'], $CONF);
            $data = array("delete_key" => $delete_key);
            $post_id = $db->update($data, 'uploads', 'url=?', array($file));
            unset($_POST);
            echo json_encode(array('result' => array('url' => get_page_url("u", $CONF) . '/' . $file_db['url'] . '/' . $delete_key)));
        } else {
            echo json_encode(array('error' => $CONF['errors']['NoFile']));
        }
    } else {
        echo json_encode(array('error' => $CONF['errors']['InvRequest']));
    }
} else {
    echo json_encode(array('error' => $CONF['errors']['InvRequest']));
}
예제 #30
0
function get_post_url()
{
    return is_single() || is_home() ? get_permalink() : get_page_url();
}