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


PHP Config::getConfigParams方法代码示例

本文整理汇总了PHP中Config::getConfigParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getConfigParams方法的具体用法?PHP Config::getConfigParams怎么用?PHP Config::getConfigParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


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

示例1: displayTwextra

function displayTwextra($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $show_maintenance_page = $config_params['show_maintenance_page'];
    $print_full_message_list = $config_params['print_full_message_list'];
    $search_len_max = $config_params['search_len_max'];
    $search_len_size = $config_params['search_len_size'];
    $search_count_offset = $config_params['search_count_offset'];
    if ($show_maintenance_page == 1) {
        maintenance_page();
    }
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    if (isset($_REQUEST['message_from'])) {
        $message_from = $_REQUEST['message_from'];
        //validate data..
    } else {
        $message_from = 0;
    }
    if (isset($_REQUEST['order'])) {
        $order = $_REQUEST['order'];
        //validate data..
    }
    if (isset($_REQUEST['toggle'])) {
        if ($_REQUEST['asc_desc'] == 'asc') {
            $asc_desc = 'desc';
        } else {
            $asc_desc = 'asc';
        }
    } else {
        $asc_desc = $_REQUEST['asc_desc'];
    }
    //if not set, define the default values
    if (empty($order)) {
        $order = 'created';
    }
    if (empty($asc_desc)) {
        $asc_desc = 'desc';
    }
    if (isset($_REQUEST['less'])) {
        $next = 'less';
    } else {
        $next = 'more';
    }
    $search = $_REQUEST['search'];
    $model = new TwextraModel();
    //
    //$message_id, $created, $view_count, $last_viewed, $prefix
    $length = 20;
    //number of messages to get
    $message_history = $model->get_twextra_search($screen_name, $message_from, $next, $order, $asc_desc, $length, $search);
    $msg_cnt = $message_history[0]['msg_cnt'];
    $msg_pages = ceil($msg_cnt / 20);
    $msg_current = ceil($message_from / 20) + 1;
    $msg_page_of_pages = "Page {$msg_current} of {$msg_pages}";
    $model = new TwextraModel();
    $user_info = $model->get_user_info($message_history[0]['message_id']);
    $display_remote_ip = trim($_SERVER['REMOTE_ADDR']);
    logger($script_path . "  display_remote_ip: ", $display_remote_ip);
    //don't count twitter bot access for correct view count..
    if ($_SERVER['REMOTE_ADDR'] == '128.242.241.134') {
        //$view_inc = false;
        return;
    }
    $screen_name = trim($user_info['screen_name']);
    //screen name of poster
    $name = trim($user_info['name']);
    $location = trim($user_info['location']);
    $description = trim($user_info['description']);
    $user_image_url = trim($user_info['user_image_url']);
    $message_totals = $model->get_message_totals();
    //round to nearest thousand:
    $message_totals = $message_totals - $message_totals % 1000;
    //$message_totals = $message_totals - $search_count_offset;
    $message_totals = number_format($message_totals);
    //format into human readable form
    if (isset($_SESSION['profile_image_url'])) {
        $message_created_by = "";
        //redundant, was used to concatenate profile_image_url
    }
//.........这里部分代码省略.........
开发者ID:raj4126,项目名称:twextra,代码行数:101,代码来源:searchTwextra.php

示例2: __construct

 function __construct($subject, $pattern_to_embed)
 {
     //convert all html entities to their applicable characters??
     $this->subject = $subject;
     $this->pattern_to_embed = $pattern_to_embed;
     $config_params = Config::getConfigParams();
     $this->twitter_embedded_token_max = $config_params['twitter_embedded_token_max'];
     if ($pattern_to_embed == 'at_reply') {
         //$this->pattern = "/(\s|>|)@[_a-zA-Z0-9]{1,15}/";
         $this->pattern = "/(\\s|>|\\.| |^)@[_a-zA-Z0-9]{1,15}/";
     } else {
         if ($pattern_to_embed == 'hash_tag') {
             $this->pattern = "/#[a-zA-Z][_a-zA-Z0-9]{1,139}(\\s|<|&nbsp;|\$)/";
         } else {
             if ($pattern_to_embed == 'link') {
                 //$this->pattern = '/https?:\/\/[A-Za-z0-9.?&=+;:~#_%\-\/]+(<|\s|&nbsp;|$)/'; //k-original
                 $this->pattern = '/(h|H)(t|T)(t|T)(p|P)(s|S)?:\\/\\/[A-Za-z0-9.?&=+;:~#!_%,\\-\\/]+(<|\\s|&nbsp;|\\n|$)/';
                 //k-original
             } else {
                 if ($pattern_to_embed == 'email') {
                     //$this->pattern = '/(\s|>)[_a-zA-Z0-9-_.]+[_a-zA-Z0-9-_]+@[_a-zA-Z0-9]+.[_a-zA-Z0-9]+(\s|<)/';
                     $this->pattern = '/(\\s|>)[_a-zA-Z0-9-_.]+[_a-zA-Z0-9-_]+@[_a-zA-Z0-9]+.[_a-zA-Z0-9]+(\\s|<|&nbsp;)/';
                 }
             }
         }
     }
 }
开发者ID:raj4126,项目名称:twextra,代码行数:27,代码来源:embed_in_link.php

示例3: display_content

function display_content($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    $header = header_html($prefix);
    //
    //..........................................................
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $message = '';
    $message .= $doctype;
    $message .= "<html {$html_attribute} >\n";
    $message .= $header;
    $message .= "<body>\n";
    $message .= "<div class='p5_wrapper'>\n";
    $message .= "<div class='p5_page'>\n";
    $message .= $banner;
    $message .= "<div style='margin-left:auto;margin-right:auto;margin-bottom:20px;width:768px;font-size:0.8em;' >\n";
    //p5_main
    $message .= "<h3>Contacting Twextra</h3>";
    $message .= "If you have any problems, questions, or feedback send email to: ";
    $message .= "<br /><br />contact@twextra.com";
    $message .= "<br style='clear:both;' />";
    $message .= "</div>\n";
    //p5_main
    $message .= $footer;
    $message .= "</div>\n";
    //page
    $message .= "</div>\n";
    //wrapper
    $message .= $godaddy_analytics;
    $message .= "</body>\n</html>\n";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:58,代码来源:contact.php

示例4: display_about

function display_about($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    $header = header_html($prefix);
    //
    //..........................................................
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $message = '';
    $message .= $doctype;
    $message .= "<html {$html_attribute} >\n";
    $message .= $header;
    $message .= "<body>\n";
    $message .= "<div class='p5_wrapper'>\n";
    $message .= "<div class='p5_page'>\n";
    $message .= $banner;
    $message .= "<div style='margin-left:auto;margin-right:auto;margin-bottom:20px;width:768px;font-size:0.8em;' >\n";
    //p5_main
    $message .= "<h3>About Twextra</h3>";
    $message .= "Ever wish you could write a message longer than 140 characters on\nTwitter or Linkedin?  Well, that's exactly what Twextra enables,\nplus much more.  Take a look at Twextra's features:\n<ul style='margin:0px 0px 10px 25px'>\n<li>\n<span style='background-color:yellow;'>Super-size</span> - With Twextra you can create huge messages of up to\n<i>100,000 characters</i>.\n</li>\n\n<li>\n<span style='background-color:yellow;'>Rich-text</span> - Create messages with formatting such as<i> bold, italic,\nunderline, colored-text, emoticons, </i>etc.\n</li>\n<li>\n<span style='background-color:yellow;'>Multi-media</span> - Embed <i>videos</i> and <i>images</i> into your messages to enable more interesting communication.\n</li>\n</ul>\n\nGive Twextra a try today!";
    $message .= "<br style='clear:both;' />";
    $message .= "</div>\n";
    //p5_main
    $message .= $footer;
    $message .= "</div>\n";
    //page
    $message .= "</div>\n";
    //wrapper
    $message .= $godaddy_analytics;
    //$message .= phpinfo();
    $message .= "</body>\n</html>\n";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:58,代码来源:about.php

示例5: display_maintenance_page

function display_maintenance_page($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    $header = header_html($prefix);
    //
    //..........................................................
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $message = '';
    $message .= $doctype;
    $message .= "<html {$html_attribute} >\n";
    $message .= $header;
    $message .= "<body>\n";
    $message .= "<div class='p5_wrapper'>\n";
    $message .= "<div class='p5_page'>\n";
    $message .= $banner;
    $message .= "<div style='margin:80px auto;width:768px;font-size:1.0em;' >\n";
    //p5_main
    $message .= "<h3 style='background-color:#ee1111;width:350px;padding-left:20px;' >Twextra is Down for Maintenance</h3>";
    $message .= "Twextra is currently down for maintenance.  Please check back in a few hours.";
    $message .= "<br style='clear:both;' />";
    $message .= "</div>\n";
    //p5_main
    $message .= $footer;
    $message .= "</div>\n";
    //page
    $message .= "</div>\n";
    //wrapper
    $message .= $godaddy_analytics;
    $message .= "</body>\n</html>\n";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:57,代码来源:maintenance_page.php

示例6: windex

function windex()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    //    if (isset($_REQUEST['weditor'])) {
    //        $user = 'raj4126';
    //        $note = $_REQUEST['weditor'];
    //        $tag = $_REQUEST['tag'];
    //        $action = $_REQUEST['action'];
    //        $wid = $_REQUEST['wid'];
    //        print_r($_REQUEST); exit;
    //        $model = new TwextraModel();
    //        $model->saveNote($user, $note, $tag, $action, $wid);
    //    }
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n<head>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n</head>\n<body>\n<div class='wrapper'>\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='float:left;clear:both;margin-left:auto;margin-right:auto;width:800px;'>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=create'>Create a webnote</a></div>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=display'>Display webnotes</a></div>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=search'>Search webnotes</a></div>\n</div>";
    echo $message;
    echo $footer;
    $message = "\n</div>\n</div>\n</body>\n</html>";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:57,代码来源:index.php

示例7: display_privacy

function display_privacy($screen_name = '')
{
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $banner = banner('', 'banner');
    //(user, banner_class)
    $footer = $config_params['footer'];
    //
    $docroot = $config_params['docroot'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $script_path = __FUNCTION__;
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        //
        $model->saveStat();
    }
    $header = header_html($prefix);
    //
    //..........................................................
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $message = '';
    $message .= $doctype;
    $message .= "<html {$html_attribute} >\n";
    $message .= $header;
    $message .= "<body>\n";
    $message .= "<div class='p5_wrapper'>\n";
    $message .= "<div class='p5_page'>\n";
    $message .= $banner;
    $message .= "<div style='margin-left:auto;margin-right:auto;margin-bottom:20px;width:768px;font-size:0.8em;' >\n";
    //p5_main
    $message .= "<div class='info2'>\n<h2>Privacy Policy</h2>\n<div class='info'>\nOur Privacy Policy is designed to assist you in understanding how we collect and use the personal information you provide to us and to assist you in making informed decisions when using our site and our products and services.\n</div>\n<h3>What Information Do We Collect?</h3>\n<div class='info'>\nWhen you visit our Web site you may provide us with two types of information: personal information you knowingly choose to disclose that is collected on an individual basis and Web site use information collected on an aggregate basis as you and others browse our Web site.\n</div>\n<h3>  1.\tPersonal Information You Choose to Provide</h3>\n\n<h4>Registration Information</h4>\n\n<div class='info'>\nYou will provide us information about yourself when you register to be a member of twextra.com, register for certain services, or register for email newsletters and alerts. You may also provide additional comments on how you see twextra.com servicing your needs and interests.\n</div>\n<h4>  Email Information</h4>\n<div class='info'>\nIf you choose to correspond with us through email, we may retain the content of your email messages together with your email address and our responses. \n</div>\n<h3>  2.\tWeb Site Use Information</h3>\n<div class='info'>\nSimilar to other commercial Web sites, our Web site utilizes a standard technology called \"cookies\" (see explanation below, \"What Are Cookies?\") and Web server logs to collect information about how our Web site is used. Information gathered through cookies and Web server logs may include the date and time of visits, the pages viewed, time spent at our Web site, and the Web sites visited just before and just after our Web site.  We, our advertisers and ad serving companies may also use small technology or pieces of code to determine which advertisements and promotions users have seen and how users responded to them.\n</div>\n<h3>How Do We Use the Information That You Provide to Us?</h3>\n\n<div class='info'>\nBroadly speaking, we use personal information for purposes of administering and expanding our business activities, providing customer service and making available other products and services to our customers and prospective customers. Occasionally, we may also use the information we collect to notify you about important changes to our Web site, new services and special offers we think you will find valuable. You may notify us at any time if you do not wish to receive these offers by emailing us at contact@twextra.com.\n</div>\n<h3>   What Are Cookies?</h3>\n<div class='info'>\nA cookie is a very small text document, which often includes an anonymous unique identifier. When you visit a Web site, that site's computer asks your computer for permission to store this file in a part of your hard drive specifically designated for cookies. Each Web site can send its own cookie to your browser if your browser's preferences allow it, but (to protect your privacy) your browser only permits a Web site to access the cookies it has already sent to you, not the cookies sent to you by other sites.  Some of our business partners (e.g., advertisers) use cookies that originate from their sites. We have no access or control over those cookies.  \n</div>\n\n<h3>   How Do We Use Information We Collect from Cookies?</h3>\n<div class='info'>\nAs you use our Web site, the site uses its cookies to differentiate you from other users. In some cases, we also use cookies to prevent you from logging in more than is necessary for security. Cookies, in conjunction with our Web server's log files, allow us to calculate the aggregate number of people visiting our Web site and which parts of the site are most popular. This helps us gather feedback in order to constantly improve our Web site and better serve our customers.\n</div>\n<h3>   Sharing Information with Third Parties</h3>\n\n<div class='info'>\nWe may enter into alliances, partnerships or other business arrangements with third parties who may be given access to personal information including your name, address, telephone number and email for the purpose of providing you information regarding products and services that we think will be of interest to you. In connection with alliances, partnerships or arrangements, we may also provide certain information to third parties if we have determined that the information will be used in a responsible manner by a responsible third party. For example, some of our partners operate stores or provide services on our site, while others power offerings developed by us for your use. We may also use third parties to facilitate our business, including, but not limited to, sending email and processing credit card payments. In connection with these offerings and business operations, our partners and other third parties may have access to your personal information for use in connection with business activities. As we develop our business, we may buy or sell assets or business offerings. Customer, email, and visitor information is generally one of the transferred business assets in these types of transactions. We may also transfer such information in the course of corporate divestitures, mergers, or any dissolution.\n</div>\n<h3>   Notice of New Services and Changes</h3>\n<div class='info'>\nOccasionally, we may also use the information we collect to notify you about important changes to our Web site, new services and special offers we think you will find valuable. As our customer, you will be given the opportunity to notify us of your desire not to receive these offers by sending us an email request at contact@twextra.com.\n</div>\n<h3>  How Do We Protect Your Information? How Do We Secure Information Transmissions?</h3>\n<div class='info'>\nEmail is not recognized as a secure medium of communication. For this reason, we request that you do not send private information to us by email. Some of the information you may enter on our Web site may be transmitted securely via Secure Sockets Layer SSL encryption services. Pages utilizing this technology will have URLs that start with HTTPS instead of HTTP. Please contact contact@twextra.com if you have any questions or concerns.\n</div>\n<h3>  How Can You Access and Correct Your Information?</h3>\n\n<div class='info'>\nYou may request access to all your personally identifiable information that we collect online and maintain in our database by emailing \ncontact@twextra.com.\n</div>\n<h3>  Certain Disclosures</h3>\n<div class='info'>\nWe may disclose your personal information if required to do so by law or subpoena or if we believe that such action is necessary to (a) conform to the law or comply with legal process served on us or affiliated parties; (b) protect and defend our rights and property, our site, the users of our site, and/or our affiliated parties; (c) act under circumstances to protect the safety of users of our site, us, or third parties.\n</div>\n<h3>  What About Other Web Sites Linked to Our Web Site?</h3>\n<div class='info'>\nWe are not responsible for the practices employed by Web sites linked to or from our Web site nor the information or content contained therein. Often links to other Web sites are provided solely as pointers to information on topics that may be useful to the users of our Web site. \nPlease remember that when you use a link to go from our Web site to another Web site, our Privacy Policy is no longer in effect. Your browsing and interaction on any other Web site, including Web sites which have a link on our Web site, is subject to that Web site's own rules and policies. Please read over those rules and policies before proceeding.\n</div>\n<h3>  Your Consent</h3>\n\n<div class='info'>\nBy using our Web site you consent to our collection and use of your personal information as described in this Privacy Policy. If we change our privacy policies and procedures, we will post those changes on our Web site to keep you aware of what information we collect, how we use it and under what circumstances we may disclose it.\n</div>\n</div>\n";
    $message .= "<br style='clear:both;' />";
    $message .= "</div>\n";
    //p5_main
    $message .= $footer;
    $message .= "</div>\n";
    //page
    $message .= "</div>\n";
    //wrapper
    $message .= $godaddy_analytics;
    $message .= "</body>\n</html>\n";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:56,代码来源:privacy.php

示例8: getInstance

 public static function getInstance()
 {
     //configuration parameters:
     $config_params = Config::getConfigParams();
     $hostdb = $config_params['hostdb'];
     $database = $config_params['database'];
     $pwdb = $config_params['pwdb'];
     $userdb = $config_params['userdb'];
     if (self::$db == null) {
         //self::$db = new mysqli("173.201.217.33", "twetest", "Spearmint1", "twetest");
         self::$db = new mysqli($hostdb, $database, $pwdb, $userdb);
     }
     return self::$db;
 }
开发者ID:raj4126,项目名称:twextra,代码行数:14,代码来源:database.php

示例9: search_display

function search_display()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n\n<head>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n\n</head>\n\n<body>\n\n<div class='wrapper'>\n\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='float:left;clear:both;margin-left:auto;margin-right:auto;width:800px;'><form method='post' \n\naction='/webnotes/wrouter.php' accept-charset=\"utf-8\" >\n\n\t<input type='hidden' name='wroute' id='wroute' value='searchdisplay'> </input>\n\n\n\n\t<input id='tag' name='tag' style='width: 768px; border:solid black 1px;'></input> \n\n<div><input type='submit' name='save' id='save' value='Search' class='button'></input></div>\n\n\n\n</form></div>";
    echo $message;
    echo $footer;
    $message = "\n\n</div>\n\n</div>\n\n</body>\n\n</html>";
    echo $message;
}
开发者ID:raj4126,项目名称:twextra,代码行数:47,代码来源:search.php

示例10: header_html

function header_html($prefix = '')
{
    //if (session_id () == "") session_start ();
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $prefix_size_max = $config_params['prefix_size_max'];
    $docroot = $config_params['docroot'];
    $google_analytics = $config_params['google_analytics'];
    $css = $config_params['css'];
    $fb_app_id = $config_params['fb_app_id'];
    if ($hostname == 'http://twextra.com') {
        $host = 'Twextra';
    } else {
        if ($hostname == 'http://twetest.com') {
            $host = 'Twetest';
        } else {
            header("Location:{$hostname}?error=Hostname not recognized.");
            exit;
        }
    }
    $header = "<head>\n";
    $header .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
    $header .= '<meta http-equiv="Pragma" content="no-cache" />' . "\n";
    $header .= '<meta http-equiv="Cache-Control" content="no-store, must-revalidate, no-cache, private, 
max-age=0, post-check=0, pre-check=0" />' . "\n";
    $header .= '<meta http-equiv="Expires" content="Fri, 1 Jan 2010 01:00:00 GMT" />' . "\n";
    $header .= "<meta name='description' content='Twextra is a service for sharing long, rich-text messages with images \n\tand video on Twitter, LinkedIn and more.' /> \n<meta name='keywords' content='Tweets, Twitter, LinkedIn, Instant Messaging, Rich Text, Micro blog' />\n";
    $header .= "<link rel='stylesheet' type='text/css' href='" . $css . "' />\n";
    if (isset($prefix) && trim($prefix) != '') {
        $header .= "<title> {$prefix} (Twextra)</title>\n";
        //$_SESSION['prefix']= '';//initialize prefix after consuming it, so as to be ready for next tweet
    } else {
        $header .= '<title>Twextra - When you NEED more than 140 characters</title>' . "\n";
    }
    $header .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js' ></script>\n";
    //$header .= "<script type='text/javascript' src='/scripts/jquery/jquery.js' ></script>\n";
    $header .= "<script type='text/javascript' src='/scripts/ckeditor/ckeditor.js'></script>\n";
    $header .= "<script type='text/javascript' src='/lib/twextra.lib.js'></script>\n";
    $header .= "<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />\n";
    $header .= $google_analytics;
    $header .= "<meta property=\"og:site_name\" content=\"{$host}\">\n\t\t<meta property=\"fb:app_id\" value=\"{$fb_app_id}\">\n\t\t<meta property=\"fb:admins\" content=\"{$host}\">";
    $header .= "</head>\n";
    return $header;
}
开发者ID:raj4126,项目名称:twextra,代码行数:45,代码来源:header_html.php

示例11: delete_message

function delete_message()
{
    $screen_name = $_SESSION['user'];
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $css = $config_params['css'];
    $tweet_size_max = $config_params['tweet_size_max'];
    $tweet_size_max_google = $config_params['tweet_size_max_google'];
    $hostname = $config_params['hostname'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $script_path = __FUNCTION__;
    $message_list_delete = $_REQUEST['delete'];
    $model = new TwextraModel();
    $model->deleteTweetList($message_list_delete);
    header("Location:{$hostname}/displayMessageHistory.php");
    exit;
}
开发者ID:raj4126,项目名称:twextra,代码行数:19,代码来源:message_delete.php

示例12: create

 function create($data)
 {
     validate_access_webnotes();
     //configuration parameters:
     $config_params = Config::getConfigParams();
     $hostname = $config_params['hostname'];
     $tweet_size_max = $config_params['tweet_size_max'];
     $prefix_size_max = $config_params['prefix_size_max'];
     $docroot = $config_params['docroot'];
     $debug = $config_params['debug'];
     $cookie_name = $config_params['cookie_name'];
     $script_path = __FUNCTION__;
     //logger ( $script_path."  Topx: ", "", false ); //start with the same log file
     logger($script_path . "  Topx: ", "", true);
     //start with a new log file
     logger("//..............................................START A NEW TRANSACTION..........................\n        ............................................//");
     $note = '';
     $wid = -1;
     header("Location:{$hostname}/webnotes/create.php");
     exit;
 }
开发者ID:raj4126,项目名称:twextra,代码行数:21,代码来源:wcontroller.php

示例13: banner_index

function banner_index($user = '')
{
    //$hostname = 'http://twetest.com';
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    //...................
    if (session_id() == "") {
        session_start();
    }
    if (isset($_SESSION['user']) && trim($_SESSION['user'] != '')) {
        $user = $_SESSION['user'];
        $greeting = '';
        $greeting .= "<a href='http://twitter.com/" . $user . "' target='_blank' style='float:right;' >" . $user . "@twitter</a>\n\t\t\t<div style='float:right;' >Hi&nbsp;</div>";
        $message_history = "<div style='float:right;font-size:0.8em;' ><a href='{$hostname}/displayMessageHistory.php'>\n\t\tMessage History</a></div>";
        $signout = "<span >Sign out</span>";
    } else {
        if (isset($_COOKIE['tw_user_id']) && trim($_COOKIE['tw_user_id']) != '') {
            $user_id_hash = $_COOKIE['tw_user_id'];
            $model = new TwextraModel();
            $user = $model->get_screen_name($user_id_hash);
            $_SESSION['user'] = $user;
            $greeting = '';
            $greeting .= "<a href='http://twitter.com/" . $user . "' target='_blank' style='float:right;' >" . $user . "@twitter</a>\n\t\t\t<div style='float:right;' >Hi&nbsp;</div>";
            $message_history = "<div style='float:right;font-size:0.8em;' ><a href='{$hostname}/displayMessageHistory.php'>\n\t\tMessage History</a></div>";
            $signout = "<span >Sign out</span>";
        } else {
            $greeting = '';
            $signout = '';
        }
    }
    //.....................................
    //<div class='rbanner'>When you NEED more than 140 characters</div>
    $banner = '';
    $banner .= "\n<div class='banner_index'>\n<div class='banner_content_index'>\n<div class='lbanner'><a href='" . $hostname . "'><img src='/images/twextra_logo.png' alt ='twextra logo' /></a></div>\n<div class='rbanner'>Create <span style='font-size:22px;font-weight:bold;'>large</span> (140+), \n<span style='color:blue;background-color:yellow;'>rich-text</span> messages <br /> for Twitter, LinkedIn, or anywhere else\n</div>\n<br style='clear:both' />\n</div>\n<div style='float:right; width:200px; margin-right:10px;' >";
    $banner .= "\n<div style='float:right; margin-top:10px; width:100%; color:black; font-size:0.8em;' >" . $greeting . "   </div>";
    $banner .= "{$message_history}\n<div style='float:right; clear:right; width:100%; font-size:0.8em;' > ";
    $banner .= "\n<a href='" . $hostname . "/signout.php' style='float:right' >" . $signout . " </a></div>\n<br style='clear:both;' />\n</div>\n</div>";
    return $banner;
}
开发者ID:raj4126,项目名称:twextra,代码行数:39,代码来源:banner_index.php

示例14: set_tw_access_token

 function set_tw_access_token($access_token)
 {
     $script_path = __FUNCTION__;
     //		$access_token = Array ( 'oauth_token' => '20897173-zbS904r4c2FZZvqKFpk2EuIzlcghC1SgGc0ZJfLL7',
     //                        'oauth_token_secret' => 'RPLf7rSCr2JLv31NUw2DND3NFCcmGOTKqK3pi38Ew',
     //                        'user_id' => '20897173',
     //                        'screen_name' => 'raj4126' );
     //configuration parameters:
     $config_params = Config::getConfigParams();
     $cookie_name = $config_params['cookie_name'];
     $link = DbConnect::getInstance();
     $command = "SET NAMES 'utf8'";
     $stmt = mysqli_prepare($link, $command);
     mysqli_stmt_execute($stmt);
     $error = 'no error';
     $user_id = $access_token['user_id'];
     $oauth_token = $access_token['oauth_token'];
     $oauth_token_secret = $access_token['oauth_token_secret'];
     $screen_name = $access_token['screen_name'];
     $oauth_verifier = "-";
     $user_id_hash = sha1($user_id, false);
     logger($script_path . "  user_id:user_id_hash:oauth_token:oauth_token_secret:screen_name:: ", $user_id . ":" . $user_id_hash . ":" . $oauth_token . ":" . $oauth_token_secret . ":" . $screen_name);
     //use REPLACE INSTEAD OF INSERT TO DELETE OLD MATCHING ENTRIES(ON UNIQUE KEYS) BEFORE AN INSERT
     //correct logic: update if screen name already exists, insert otherwise..
     //original code...............................................
     $command = "REPLACE INTO tw_token\n                 ( user_id_hash, oauth_token, oauth_token_secret, oauth_verifier, user_id, screen_name, \n                  created )\n                   VALUES (?, ?, ?, ?, ?, ?, now())";
     logger($script_path . "  sql: ", $command);
     if ($stmt = mysqli_prepare($link, $command)) {
         mysqli_stmt_bind_param($stmt, 'ssssss', $user_id_hash, $oauth_token, $oauth_token_secret, $oauth_verifier, $user_id, $screen_name);
         $result = mysqli_stmt_execute($stmt);
         if ($result == true) {
             logger($script_path . "  success ");
         } else {
             logger($script_path . "  failure: ");
         }
     } else {
         $error = 'error';
     }
     //........................................................................
     logger($script_path . "  error: ", $error);
     mysqli_stmt_close($stmt);
     setcookie($cookie_name, $user_id_hash, time() + 3600 * 24 * 14, "/");
     //set expiry time of 2 weeks
     return $error;
 }
开发者ID:raj4126,项目名称:twextra,代码行数:45,代码来源:twextra_model.php

示例15: index

function index($tweet = '', $error = '', $message_id = '')
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $enable_stats = $config_params['enable_stats'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $show_maintenance_page = $config_params['show_maintenance_page'];
    $fb_app_id = $config_params['fb_app_id'];
    $search_count_offset = $config_params['search_count_offset'];
    if ($show_maintenance_page == 1) {
        maintenance_page();
    }
    if (isset($_REQUEST['screen_name_reply'])) {
        $screen_name_reply = $_REQUEST['screen_name_reply'];
    } else {
        $screen_name_reply = '';
    }
    if (isset($_REQUEST['message_id_reply'])) {
        $message_id_reply = $_REQUEST['message_id_reply'];
    } else {
        $message_id_reply = '';
    }
    logger($script_path . "  index page: ");
    logger($script_path . " cookie:", $_COOKIE);
    //---------------------------------------------------
    $model = new TwextraModel();
    $message_totals = $model->get_message_totals();
    //round to nearest thousand:
    $message_totals = $message_totals - $message_totals % 1000;
    //$message_totals = $message_totals - $search_count_offset;
    $message_totals = number_format($message_totals);
    //format into human readable form
    //---------------------------------------------------
    //get twitter credentials and store in session variables for use in banner
    if (isset($_COOKIE[$cookie_name])) {
        $controller = new TwextraController();
        $result_t = $controller->getTwCredentials($_COOKIE[$cookie_name]);
        //
        $screen_name = $result_t['screen_name'];
        logger($script_path . " result_t:", $result_t);
    }
    $script_path = __FUNCTION__;
    logger($script_path . "  session: ", $_SESSION);
    logger($script_path . "  request: ", $_REQUEST);
    //save logs
    if ($enable_stats) {
        $model = new TwextraModel();
        $model->saveStat();
    }
    //set error flag if a twitter error, or any other error
    if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'twitter_error') {
        $error = "Twitter is returning an error right now. Please try again later. \n\t\tFollow <a href='http://twitter.com/twextradotcom' target='_blank' >@twextradotcom</a> for updates.";
    } else {
        if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'ep4') {
            $error = $ep4;
        } else {
            if (isset($_REQUEST['error'])) {
                $error = urldecode($_REQUEST['error']);
            } else {
                if (isset($_REQUEST['signout'])) {
                    $error = "You are now signed out of Twextra, but you may still be signed in on Twitter.  " . $error;
                    $_SESSION['user'] = '';
                } else {
                    if (isset($_SESSION['error_size'])) {
                        $error = $_SESSION['error_size'];
                        unset($_SESSION['error_size']);
                    }
                }
            }
        }
    }
    if (isset($_SESSION['tweet'])) {
        $tweet = $_SESSION['tweet'];
        unset($_SESSION['tweet']);
    }
    if (!empty($screen_name)) {
        $twitter_checked = 'checked';
        $twextra_checked = '';
    } else {
        if (!empty($screen_name_reply)) {
            $twitter_checked = 'checked';
            $twextra_checked = '';
        } else {
//.........这里部分代码省略.........
开发者ID:raj4126,项目名称:twextra,代码行数:101,代码来源:tw.lib.php


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