📄 wapipbscript_v1_95.php
字号:
<?php // <- Do not Remove this line
// ----------------------------------------------
// ----------------------------------------------
// ----------Sentertainment.net Presents---------
// -----------Unofficial IPB WAP Script----------
// ----------------------------------------------
// ----------------------------------------------
// Release v1.9
//
// ============SIMPLIFIED TERMS OF USE===========
// ----Under Basic GNU General Public License----
// Extra:
// This script is in no affiliation with Invision
// or any of it's members and this script may not
// be sold in any form.
// As request by the author of this code, we ask
// (not rquire) that in the event of modding this
// code, that you send your modded copy to the
// author for open-source development.
// If any of these terms are not to your needs,
// then permission from the author is before any
// terms of use may be broken.
// THIS HEADER MAY NOT BE CHANGED OR REMOVED
// WITHOUT PERMISSION FROM THE ORIGINAL CREATORS
//
//
// INSTRUCTIONS:
// Just Fill out all required info to meet your Forums
// and place this file anywhere you please on your
// server. Unrestricted fil access to this script
// may be required for Attachments to work.
//
//
// ===================CREDITS====================
// --------Giving Credit Where it is Due!--------
//
// TeraByte:
// Brought unnoticed Nav Error to my attention!
//
// Israel de Souza Rocha of PHPClasses.org:
// Had a simple translation procedure by leeching
// off Google! (I used his code)
//
// Palach:
// Saw a bug that I thought I had fixed long ago.
//
// All the rest goes to me! ;)
// ----------------------------------------------
// -------------Database Login Info--------------
// ----------------------------------------------
$dbuser = "sqlusername"; // Forum SQL Database Access Username
$dbpass = "sqlpass"; // Forum SQL Database Access Password
$dbname = "sqldatabasename"; // Forum SQL Database Name
$dbserver = "localhost"; // Database Server (Usualy "localhost")
// ----------------------------------------------
// ----------------Forum Settings----------------
// ----------------------------------------------
$furl = "site.com/forumdir/"; // Forum URL (Without "http://www.")
$uploadsdir = "uploads/"; // Forum Uploads Directory
$boardtype = 1; // *Feature Not Yet Complete* Board type; 1 = IPB, 2 = phpBB
$boardtitle = "Site Forums"; // Script Display Title
$boardname = "Welcome to My Forums"; // Board Display Name; Set to "<img src=\"imageurl\"/>" to use an image!
$forumpostsperpage = 5; // Number of topics to show per page (Forum View)
$topicpostsperpage = 3; // Number of posts to show per page (Topic View)
$pagecreation = 1; // Show Page Creation Time; 1=True, 0=False
$msgcharlimit = 75; // Character Limit for forum views
$topiccharlimit = 300; // Character Limit for topic views
$tableprefix = "ibf_"; // Table name prefix ex: ibf_posts
$enattach = 1; // Enable Attachments; 1 = Yes, 0 = No
$resimgview = 1; // Disable Images if current Member seetings have them disabled; 1 = Yes, 0 = No
$enemoticons = 1; // Enable Emoticons & Images; 1 = Yes, 0 = No
$autowap = 1; // Detect WAP access automatically; Display WAP Access Only
$showses = 1; // Show Session count (Current Visistors); 1 = Yes, 0 = No
$sesmin = 30; // Counts visitors within * min; Only works when $showses is enabled
$loginsesmin = 10; // Login sessions last * min when idle
$manageses = 0; // Allow Script to Manage (Delete) Old Sessions
$sesdeltime = 60; // Deletes Sessions within * min; Only works when $manageses is enabled
$viewdetails = 1; // Show Last Post Details in Forum Views; 1 = Yes, 0 = No
$allowlogin = 1; // Allow Memebers to Login (Show Login Info & Pages); 1 = Yes, 0 = No
$permview = 1; // Display Forums According to User Permissions; 1 = Yes, 0 = No
$navmode = 0; // Forum Navigation; 1 = Radio Buttons, 0 = Hyperlinks
$forumviewnavmode = 0; // Forum View Navigation (Radio Buttons May result in Error if over 15 forums)
$followperms = 1; // Respect IPB Read/Write/Reply/Edit Permissions; 1 = Yes, 0 = No
$showpinned = 1; // Show pinned topics in forum view; 1 = Yes, 0 = No
$allowreply = 1; // Allow Posting replies via WAP; 1 = Yes, 0 = No
$allownewtopics = 1; // Allow Posting new topics via WAP; 1 = Yes, 0 = No
$post_emoticons = 1; // Allow Posting emoticons; 1 = Yes, 0 = No
$emoticon_dir = "html/emoticons/"; // Directory for emoticons (in forum directory)
$post_limit = 30; // Seconds until a new post can be created, set to 0 to turn off
$add_views = 1; // Add to view counter when viewing a topic; 1 = Yes, 0 = No
$in_topic = 1; // Add in-topic location to Session information, only works when enabled on IPB
$in_forum = 1; // Add in-forum location to Session information, only works when enabled on IPB
$cat_vis = 1; // Respect Category Visibilitly; 2 = Do not show any hidden, 1 = Do Not show Disabled, 0 = Show all hidden
$lng_pack = ""; // Set to location of WAP IPB Script language pack, leave blank for English
// Original IPB Database Driver required for making posts
$ipb_db_driver = "/IPB Directory/sources/Drivers/mySQL.php";
// Tanslation Languages: en-English, de-Gernan, es-Spanish, fr-French, it-Italian, pt-Portuguese
$trans_text = 0; // Allow Translation of forums (Show Language menu); 1 = Yes, 0 = No
$trans_lang_from = "en"; // Language to Translate from.
If ($lng_pack == null) {
$strViewFullPost = "View Full Post";
$strLogin = "Login";
$strLogout = "Logout";
$strWelcome = "Welcome";
$strWAP_Only = "<p><b>WAP Access Only!</b><br/><br/>Click <a href=\"http://www." . $furl . "\">here</a> to visit the HTML enabled forums.";
$strLast5 = "Last $forumpostsperpage Active Topics";
$strCategories = "Categories";
$strForums = "Forums";
$strEnglish = "English";
$strFrench = "French";
$strGerman = "German";
$strSpanish = "Spanish";
$strItalian = "Italian";
$strPortugese = "Portugese";
$strVisitorsOnline = "visitors online:";
$strMembers = "Members";
$strGuests = "Guests";
$strWAP = "WAP";
$strHome = "Home";
$strCardCreated1 = "Card Created in";
$strCardCreated2 = " Sec.";
$strNoPermTopic = "You do not have permission to view this topic.";
$strNoPermForum = "You do not have permission to view this forum.";
$strNoPermCategory = "You do not have permission to view this category.";
$strLastPost = "Last Post:";
$strUser = "User:";
$strPost = "Post:";
$strPrev = "Prev";
$strNext = "Next";
$strUsername = "Username:";
$strPassword = "Password:";
$strBack = "Back";
$strLoginSuccessful = "Login Successful";
$strLoggedInAs = "Logged in as";
$strTimeOut = "Session will timeout when idle for more than $loginsesmin minutes.";
$strBadLogin = "Bad Username/Password";
$strLogoutComplete = "Logout Complete";
$strPinned = "Pinned:";
$strTopic = "Topic:";
$strFloodControl = "$post_limit sec. flood control.";
$strNewThread = "New Thread";
$strAttached = "Attached:";
$strReply = "Reply";
$strFullPostView = "Full Post View";
$strReplyToTopic = "Reply to Topic";
$strReply2 = "Reply:";
$strPostReply = "Post Reply";
$strReplyError = "Error:<br/>Unable to reply.";
$strNewTopic = "New Topic";
$strPost2 = "Post";
$strNewTopic2 = "New Topic:";
$strTitle2 = "Title:";
$strTitle = "Title";
$strDesc2 = "Desc:";
$strDesc = "Desc";
$strPostSuccessful = "Post Sucessful";
} else {
include($lng_pack);
}
// Below this line is forum specific data already set for
// Invision Power Boards.
// ------------------Table Info------------------
If ($boardtype == 1) {
// Deafult IPB Configuration
$poststable = "posts";
$categoriestable = "categories";
$forumstable = "forums";
$topicstable = "topics";
$sessionstable = "sessions";
$memberstable = "members";
$tid_column = "tid";
$pid_column = "pid";
$topic_id_column = "topic_id";
$member_id_column = "member_id";
$member_name_column = "member_name";
$forum_id_column = "forum_id";
$ip_address_column = "ip_address";
$running_time_column = "running_time";
$post_id_column = "post_id";
$category_column = "category";
$name_column = "name";
$position_column = "position";
$last_post_column = "last_post";
$title_column = "title";
$post_column = "post";
$post_date_column = "post_date";
$posts_column = "posts";
$views_column = "views";
$author_name_column = "author_name";
$pinned_column = "pinned";
} else {
// No Support for phpBB yet! :(
}
// ----------------------------------------------
// ----------------------------------------------
// ---------Do Not Change Below this line--------
// ----------------------------------------------
// ----------------------------------------------
header("Cache-Control: no-store, no-cache, must-revalidate");
If ($autowap == 1) {
if(strpos(strtoupper($HTTP_ACCEPT),'VND.WAP.WML') > 0) {
$brow = 'WML';
} else {
$browser=substr(trim($HTTP_USER_AGENT),0,4);
if($browser=='Noki' || // Nokia phones and emulators
$browser=='Eric' || // Ericsson WAP phones and emulators
$browser=='WapI' || // Ericsson WapIDE 2.0
$browser=='MC21' || // Ericsson MC218
$browser=='AUR ' || // Ericsson R320
$browser=='R380' || // Ericsson R380
$browser=='UP.B' || // UP.Browser
$browser=='WinW' || // WinWAP browser
$browser=='UPG1' || // UP.SDK 4.0
$browser=='upsi' || // another kind of UP.Browser ??
$browser=='QWAP' || // unknown QWAPPER browser
$browser=='Jigs' || // unknown JigSaw browser
$browser=='Java' || // unknown Java based browser
$browser=='Alca' || // unknown Alcatel-BE3 browser (UP based?)
$browser=='MITS' || // unknown Mitsubishi browser
$browser=='MOT-' || // unknown browser (UP based?)
$browser=='My S' || // unknown Ericsson devkit browser ?
$browser=='WAPJ' || // Virtual WAPJAG www.wapjag.de
$browser=='fetc' || // fetchpage.cgi Perl script from www.wapcab.de
$browser=='ALAV' || // yet another unknown UP based browser ?
$browser=='Wapa') // another unknown browser (Web based 'Wapalyzer'?)
{
$brow = 'WML';
} else {
$brow = 'HTML';
}
}
if($brow == 'HTML') {
header("Content-type: text/html");
echo($strWAP_Only);
exit;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -