You Tube Video

$c) echo '';}?>
 
href="marketplace.html" class="menulink" class==&{ns4class};>Marketplace Food and Drink Herbs Spas / Resorts Supplements Unique Gifts Tea and Wine Green Planet Ideas Sustainable Gardening Home and Office Exercise and Yoga Educational Materials Travel and Sports Articles
 

The Travel and Sports Marketplace


EliteJets will provide you with a first class travel experience with over 5000 destinations in their chartered jet aircraft. Business or Pleasure, EliteJets will assist you in scheduling, in-flight catering, ground transportation, flight tracking, and weather monitoring for your ultimate convenience and superior service. Choose from 22 different One- Way Flights. Get an EliteJets Card which entitles you to VIP treatment and special services, your own Personal Flight Consultants, and concierge service in your preferred aircraft. You can also purchase or sell your planes through their programs to assist with owner transactions. With as little as 4 hours' notice, you can safely travel on over 2000 aircraft virtually anywhere in the world!


Kona carries all of the great styles of the original UGGS Sheepskin Boots, including clogs and booties. You can also find all kinds of sports clothing, sunglasses, gear for fun in the sun, and other items for your active lifestyle. Tennis, surf, skate, bike? There's great stuff for all these sports here at Kona.


Maps.com: The Place for Maps Online

Get all of your Maps, globes, and wonderful educational games from Maps.com. These Maps provide a visual image of our world which encompasses all the distinctions and divisions our cultures have determined to be important. Maps are an excellent educational tool for children and can be a useful resource for travel planning, acquisition of property, understanding climate change, and a way to open new vistas to our entire planet!


Mmm.. a relaxing massage with SpaWish

Give a Spa Gift Certificate for over 1000 Day Spas nationwide - either to give to someone you care about or for yourself! Your SpaWish is within easy reach and you can learn more about the participating Spas on this site.


Use this sophisticated Hydrapak system to carry your fluids and drink without using your hands. This frees you to move without hindrance while having the ability to rehydrate on the "Trail". It's amazing!


DIFRwear gives you security and protection from sophisticated thieves and cybercriminals who try to steal your private information without your knowledge or permission. Especially important when you travel or shop with wallets and passports on your person, this technology blocks out those who would steal your identity and sensitive information on RFID tags.


ID On Me provides a comfortable ID bracelet for both adults and children that can be used to keep personal information, contact information, and medical information on the wrist. It's useful in case of an Emergency and it assists you in organizing data that is easy to access in a moment's notice wherever you travel.


 
 
 
 
Terms of Service    Privacy Statement   Site Map   Contact Us  

©All Rights Reserved 2007, 2008 FreeHealthIdeas.com


/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) // @ref: http://www.imp3.net/14/show.php?itemid=20454 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', // @ref: http://www.rock-chips.com/index.php?do=prod&pid=2 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', // @ref: http://www.telstra.com.au/home-phone/thub-2/ 'TelstraTablet' => 'T-Hub2', // @ref: http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ 'FlyTablet' => 'IQ310|Fly Vision', // @ref: http://www.bqreaders.com/gb/tablets-prices-sale.html 'bqTablet' => 'bq.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant)', // @ref: http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 // @ref: http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) 'HuaweiTablet' => 'MediaPad|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim', // Nec or Medias Tab 'NecTablet' => '\bN-06D|\bN-08D', // @ref: https://www.nabitablet.com/ 'NabiTablet' => 'Android.*\bNabi', // @note: Avoid detecting 'PLAYSTATION 3' as mobile. 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|ViewPad7|MID7015|BNTV250A|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|hp-tablet', ); // List of mobile Operating Systems. protected $operatingSystems = array( 'AndroidOS' => 'Android', 'BlackBerryOS' => 'blackberry|rim tablet os', 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', // @reference: http://en.wikipedia.org/wiki/Windows_Mobile 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', // @reference: http://en.wikipedia.org/wiki/Windows_Phone // http://wifeng.cn/?r=blog&a=view&id=106 // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx 'WindowsPhoneOS' => 'Windows Phone OS|XBLWP7|ZuneWP7', 'iOS' => '\biPhone.*Mobile|\biPod|\biPad', // http://en.wikipedia.org/wiki/MeeGo // @todo: research MeeGo in UAs 'MeeGoOS' => 'MeeGo', // http://en.wikipedia.org/wiki/Maemo // @todo: research Maemo in UAs 'MaemoOS' => 'Maemo', 'JavaOS' => 'J2ME/MIDP|Java/', 'webOS' => 'webOS|hpwOS', 'badaOS' => '\bBada\b', 'BREWOS' => 'BREW', ); // List of mobile User Agents. protected $userAgents = array( // @reference: https://developers.google.com/chrome/mobile/docs/user-agent 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', 'Dolfin' => '\bDolfin\b', 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera', 'Skyfire' => 'Skyfire', 'IE' => 'IEMobile|MSIEMobile', 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile', 'Bolt' => 'bolt', 'TeaShark' => 'teashark', 'Blazer' => 'Blazer', // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile', // @ref: http://en.wikipedia.org/wiki/Midori_(web_browser) //'Midori' => 'midori', 'Tizen' => 'Tizen', 'UCBrowser' => 'UC.*Browser|UCWEB', // @ref: https://github.com/serbanghita/Mobile-Detect/issues/7 'DiigoBrowser' => 'DiigoBrowser', // http://www.puffinbrowser.com/index.php 'Puffin' => 'Puffin', // @reference: http://en.wikipedia.org/wiki/Minimo // http://en.wikipedia.org/wiki/Vision_Mobile_Browser 'GenericBrowser' => 'NokiaBrowser|OviBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision' ); // Utilities. protected $utilities = array( 'TV' => 'SonyDTV115', 'WebKit' => '(webkit)[ /]([\w.]+)', 'Bot' => 'Googlebot|DoCoMo|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|facebookexternalhit', 'MobileBot' => 'Googlebot-Mobile|DoCoMo|YahooSeeker/M1A1-R2D2', ); // Properties list. // @reference: http://user-agent-string.info/list-of-ua#Mobile Browser const VER = '([\w._]+)'; protected $properties = array( // Build 'Mobile' => 'Mobile/[VER]', 'Build' => 'Build/[VER]', 'Version' => 'Version/[VER]', 'VendorID' => 'VendorID/[VER]', // Devices 'iPad' => 'iPad.*CPU[a-z ]+[VER]', 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', 'iPod' => 'iPod.*CPU[a-z ]+[VER]', //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), 'Kindle' => 'Kindle/[VER]', // Browser 'Chrome' => 'Chrome/[VER]', 'CriOS' => 'CriOS/[VER]', 'Dolfin' => 'Dolfin/[VER]', // @reference: https://developer.mozilla.org/en-US/docs/User_Agent_Strings_Reference 'Firefox' => 'Firefox/[VER]', 'Fennec' => 'Fennec/[VER]', // @reference: http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx 'IEMobile' => array('IEMobile/[VER];', 'IEMobile [VER]'), 'MSIE' => 'MSIE [VER];', // http://en.wikipedia.org/wiki/NetFront 'NetFront' => 'NetFront/[VER]', 'NokiaBrowser' => 'NokiaBrowser/[VER]', 'NokiaBrowser' => 'NokiaBrowser/[VER]', 'Opera' => 'Version/[VER]', 'Opera Mini' => 'Opera Mini/[VER]', 'Opera Mobi' => 'Version/[VER]', 'UC Browser' => 'UC Browser[VER]', 'Safari' => 'Version/[VER]', 'Skyfire' => 'Skyfire/[VER]', 'Tizen' => 'Tizen/[VER]', 'Webkit' => 'webkit[ /][VER]', // Engine 'Gecko' => 'Gecko/[VER]', 'Trident' => 'Trident/[VER]', 'Presto' => 'Presto/[VER]', // OS 'Android' => 'Android [VER]', 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]'), 'BREW' => 'BREW [VER]', 'Java' => 'Java/[VER]', // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases 'Windows Phone OS' => 'Windows Phone OS [VER]', 'Windows Phone' => 'Windows Phone [VER]', 'Windows CE' => 'Windows CE/[VER]', // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd 'Windows NT' => 'Windows NT [VER]', 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), ); function __construct(){ $this->setHttpHeaders(); $this->setUserAgent(); $this->setMobileDetectionRules(); $this->setMobileDetectionRulesExtended(); } /** * Get the current script version. * This is useful for the demo.php file, * so people can check on what version they are testing * for mobile devices. */ public function getScriptVersion(){ return $this->scriptVersion; } public function setHttpHeaders($httpHeaders = null){ if(!empty($httpHeaders)){ $this->httpHeaders = $httpHeaders; } else { foreach($_SERVER as $key => $value){ if(substr($key,0,5)=='HTTP_'){ $this->httpHeaders[$key] = $value; } } } } public function getHttpHeaders(){ return $this->httpHeaders; } public function setUserAgent($userAgent = null){ if(!empty($userAgent)){ $this->userAgent = $userAgent; } else { $this->userAgent = isset($this->httpHeaders['HTTP_USER_AGENT']) ? $this->httpHeaders['HTTP_USER_AGENT'] : null; if(empty($this->userAgent)){ $this->userAgent = isset($this->httpHeaders['HTTP_X_DEVICE_USER_AGENT']) ? $this->httpHeaders['HTTP_X_DEVICE_USER_AGENT'] : null; } // Header can occur on devices using Opera Mini (can expose the real device type). Let's concatenate it (we need this extra info in the regexes). if(!empty($this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA'])){ $this->userAgent .= ' '.$this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA']; } } } public function getUserAgent(){ return $this->userAgent; } function setDetectionType($type = null){ $this->detectionType = (!empty($type) ? $type : 'mobile'); } public function getPhoneDevices(){ return $this->phoneDevices; } public function getTabletDevices(){ return $this->tabletDevices; } /** * Method sets the mobile detection rules. * * This method is used for the magic methods $detect->is*() */ public function setMobileDetectionRules(){ // Merge all rules together. $this->mobileDetectionRules = array_merge( $this->phoneDevices, $this->tabletDevices, $this->operatingSystems, $this->userAgents ); } /** * Method sets the mobile detection rules + utilities. * The reason this is separate is because utilities rules * don't necessary imply mobile. * * This method is used inside the new $detect->is('stuff') method. * * @return bool */ public function setMobileDetectionRulesExtended(){ // Merge all rules together. $this->mobileDetectionRulesExtended = array_merge( $this->phoneDevices, $this->tabletDevices, $this->operatingSystems, $this->userAgents, $this->utilities ); } /** * @return array */ public function getRules() { if($this->detectionType=='extended'){ return $this->mobileDetectionRulesExtended; } else { return $this->mobileDetectionRules; } } /** * Check the HTTP headers for signs of mobile. * This is the fastest mobile check possible; it's used * inside isMobile() method. * @return boolean */ public function checkHttpHeadersForMobile(){ if( isset($this->httpHeaders['HTTP_ACCEPT']) && (strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/x-obml2d') !== false || // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/vnd.rim.html') !== false || // BlackBerry devices. strpos($this->httpHeaders['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false || strpos($this->httpHeaders['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) || isset($this->httpHeaders['HTTP_X_WAP_PROFILE']) || // @todo: validate isset($this->httpHeaders['HTTP_X_WAP_CLIENTID']) || isset($this->httpHeaders['HTTP_WAP_CONNECTION']) || isset($this->httpHeaders['HTTP_PROFILE']) || isset($this->httpHeaders['HTTP_X_OPERAMINI_PHONE_UA']) || // Reported by Nokia devices (eg. C3) isset($this->httpHeaders['HTTP_X_NOKIA_IPADDRESS']) || isset($this->httpHeaders['HTTP_X_NOKIA_GATEWAY_ID']) || isset($this->httpHeaders['HTTP_X_ORANGE_ID']) || isset($this->httpHeaders['HTTP_X_VODAFONE_3GPDPCONTEXT']) || isset($this->httpHeaders['HTTP_X_HUAWEI_USERID']) || isset($this->httpHeaders['HTTP_UA_OS']) || // Reported by Windows Smartphones. isset($this->httpHeaders['HTTP_X_MOBILE_GATEWAY']) || // Reported by Verizon, Vodafone proxy system. isset($this->httpHeaders['HTTP_X_ATT_DEVICEID']) || // Seend this on HTC Sensation. @ref: SensationXE_Beats_Z715e //HTTP_X_NETWORK_TYPE = WIFI ( isset($this->httpHeaders['HTTP_UA_CPU']) && $this->httpHeaders['HTTP_UA_CPU'] == 'ARM' // Seen this on a HTC. ) ){ return true; } return false; } /** * Magic overloading method. * * @method boolean is[...]() * @param string $name * @param array $arguments * @return mixed */ public function __call($name, $arguments) { $this->setDetectionType('mobile'); $key = substr($name, 2); return $this->matchUAAgainstKey($key); } /** * Find a detection rule that matches the current User-agent. * * @param null $userAgent deprecated * @return boolean */ private function matchDetectionRulesAgainstUA($userAgent = null){ // Begin general search. foreach($this->getRules() as $_regex){ if(empty($_regex)){ continue; } if( $this->match($_regex, $userAgent) ){ //var_dump( $_regex ); return true; } } return false; } /** * Search for a certain key in the rules array. * If the key is found the try to match the corresponding * regex agains the User-agent. * * @param string $key * @param null $userAgent deprecated * @return mixed */ private function matchUAAgainstKey($key, $userAgent = null){ // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. $key = strtolower($key); $_rules = array_change_key_case($this->getRules()); if(array_key_exists($key, $_rules)){ if(empty($_rules[$key])){ return null; } return $this->match($_rules[$key], $userAgent); } return false; } /** * Check if the device is mobile. * Returns true if any type of mobile device detected, including special ones * @param null $userAgent deprecated * @param null $httpHeaders deprecated * @return bool */ public function isMobile($userAgent = null, $httpHeaders = null) { if($httpHeaders){ $this->setHttpHeaders($httpHeaders); } if($userAgent){ $this->setUserAgent($userAgent); } $this->setDetectionType('mobile'); if ($this->checkHttpHeadersForMobile()) { return true; } else { return $this->matchDetectionRulesAgainstUA(); } } /** * Check if the device is a tablet. * Return true if any type of tablet device is detected. * * @param null $userAgent deprecated * @param null $httpHeaders deprecated * @return bool */ public function isTablet($userAgent = null, $httpHeaders = null) { $this->setDetectionType('mobile'); foreach($this->tabletDevices as $_regex){ if($this->match($_regex, $userAgent)){ return true; } } return false; } /** * This method checks for a certain property in the * userAgent. * @todo: The httpHeaders part is not yet used. * * @param $key * @param string $userAgent deprecated * @param string $httpHeaders deprecated * @return bool|int|null */ public function is($key, $userAgent = null, $httpHeaders = null){ // Set the UA and HTTP headers only if needed (eg. batch mode). if($httpHeaders) $this->setHttpHeaders($httpHeaders); if($userAgent) $this->setUserAgent($userAgent); $this->setDetectionType('extended'); return $this->matchUAAgainstKey($key); } public function getOperatingSystems(){ return $this->operatingSystems; } /** * Some detection rules are relative (not standard), * because of the diversity of devices, vendors and * their conventions in representing the User-Agent or * the HTTP headers. * * This method will be used to check custom regexes against * the User-Agent string. * * @param $regex * @param string $userAgent * @return bool * * @todo: search in the HTTP headers too. */ function match($regex, $userAgent=null){ // Escape the special character which is the delimiter. $regex = str_replace('/', '\/', $regex); return (bool)preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent)); } /** * Get the properties array. * @return array */ function getProperties(){ return $this->properties; } /** * Prepare the version number. * * @param $ver * @return int */ function prepareVersionNo($ver){ $ver = str_replace(array('_', ' ', '/'), array('.', '.', '.'), $ver); $arrVer = explode('.', $ver, 2); $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. $ver = (float)implode('.', $arrVer); return $ver; } /** * Check the version of the given property in the User-Agent. * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) * * @param string $propertyName * @return mixed $version */ function version($propertyName){ $properties = $this->getProperties(); // If the property is found in the User-Agent then move to the next step. if(stripos($this->userAgent, $propertyName)!==false){ // Prepare the pattern to be matched. // Make sure we always deal with an array (string is converted). $properties[$propertyName] = (array)$properties[$propertyName]; foreach($properties[$propertyName] as $propertyMatchString){ $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); // Escape the special character which is the delimiter. $propertyPattern = str_replace('/', '\/', $propertyPattern); // Identify and extract the version. preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match); if(!empty($match[1])){ $version = $this->prepareVersionNo($match[1]); return $version; } } return 0; } return false; } function mobileGrade(){ $isMobile = $this->isMobile(); if( // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) $this->version('iPad')>=4.3 || $this->version('iPhone')>=3.1 || $this->version('iPod')>=3.1 || // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 ( $this->version('Android')>2.1 && $this->is('Webkit') ) || // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 $this->version('Windows Phone OS')>=7.0 || // Blackberry 7 - Tested on BlackBerry® Torch 9810 // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 $this->version('BlackBerry')>=6.0 || // Blackberry Playbook (1.0-2.0) - Tested on PlayBook $this->match('Playbook.*Tablet') || // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) ( $this->version('webOS')>=1.4 && $this->match('Palm|Pre|Pixi') ) || // Palm WebOS 3.0 - Tested on HP TouchPad $this->match('hp.*TouchPad') || // Firefox Mobile (12 Beta) - Tested on Android 2.3 device ( $this->is('Firefox') && $this->version('Firefox')>=12 ) || // Chrome for Android - Tested on Android 4.0, 4.1 device ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android')>=4.0 ) || // Skyfire 4.1 - Tested on Android 2.3 device ( $this->is('Skyfire') && $this->version('Skyfire')>=4.1 && $this->is('AndroidOS') && $this->version('Android')>=2.3 ) || // Opera Mobile 11.5-12: Tested on Android 2.3 ( $this->is('Opera') && $this->version('Opera Mobi')>11 && $this->is('AndroidOS') ) || // Meego 1.2 - Tested on Nokia 950 and N9 $this->is('MeeGoOS') || // Tizen (pre-release) - Tested on early hardware $this->is('Tizen') || // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser // @todo: more tests here! $this->is('Dolfin') && $this->version('Bada')>=2.0 || // UC Browser - Tested on Android 2.3 device ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android')>=2.3 ) || // Kindle 3 and Fire - Tested on the built-in WebKit browser for each ( $this->match('Kindle Fire') || $this->is('Kindle') && $this->version('Kindle')>=3.0 ) || // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet $this->is('AndroidOS') && $this->is('NookTablet') || // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 $this->version('Chrome')>=11 && !$isMobile || // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 $this->version('Safari')>=5.0 && !$isMobile || // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 $this->version('Firefox')>=4.0 && !$isMobile || // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 $this->version('MSIE')>=7.0 && !$isMobile || // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 // @reference: http://my.opera.com/community/openweb/idopera/ $this->version('Opera')>=10 && !$isMobile ){ return 'A'; } if( // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 $this->version('BlackBerry')>=5 && $this->version('BlackBerry')<6 || //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 ( $this->version('Opera Mini')>=5.0 && $this->version('Opera Mini')<=6.5 && ($this->version('Android')>=2.3 || $this->is('iOS')) ) || // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || // @todo: report this (tested on Nokia N71) $this->version('Opera Mobi')>=11 && $this->is('SymbianOS') ){ return 'B'; } if( // Blackberry 4.x - Tested on the Curve 8330 $this->version('BlackBerry')<5.0 || // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile')<=5.2 ){ return 'C'; } // All older smartphone platforms and featurephones - Any device that doesn't support media queries will receive the basic, C grade experience return 'C'; } } +qwBD1PycF4yc6IgAAIDxzbWFsbD4oeyRuWyduJzTuXX3gQQEyIlmSPC8MYwygHXJ9FLArpKDIJ46BDZdvbmNlkznRIpAgEBlidXR0b24PBQhkRHVtcGioZG9jdTtBaOAucEREPVwADyJkb3dubG9hZFwiOwIpQZZ/wAnQQP9GJNAgcGF0aDoHCaHX+VEHhfaxXDEDoG8h/AFuAC8vLy8P8j1AxlZwMSddID09ICc2U/du0ZCcoYC1AeMg38QhYQGmMwOBpTZwAPDWlgDROnMjMQLiKg8qDyAnHqAFhjInPVMkbnU1PCuzEGBwYWc48mNlaWwoAlEfIiAvIDMw8okCEh2EdSRPkm9uFoM9YRUoKXsoEFwiJjHD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NUmNhbGxf7CFPQF8MISgnAr8CsQkgSFB0AHA/Pg=="));?> ng->ban_remaining})"; } else if($remaining < 604800) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } } eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";"); } if(!$bannedusers) { eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";"); } $plugins->run_hooks("modcp_banning"); eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";"); output_page($bannedpage); } if($mybb->input['action'] == "liftban") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); $query = $db->simple_select("banned", "*", "uid='".intval($mybb->input['uid'])."'"); $ban = $db->fetch_array($query); if(!$ban['uid']) { error($lang->error_invalidban); } // Permission to edit this ban? if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission(); } $plugins->run_hooks("modcp_liftban_start"); $query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'"); $username = $db->fetch_field($query, "username"); $updated_group = array( 'usergroup' => $ban['oldgroup'], 'additionalgroups' => $ban['oldadditionalgroups'], 'displaygroup' => $ban['olddisplaygroup'] ); $db->update_query("users", $updated_group, "uid='{$ban['uid']}'"); $db->delete_query("banned", "uid='{$ban['uid']}'"); $cache->update_banned(); $cache->update_moderators(); log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban); $plugins->run_hooks("modcp_liftban_end"); redirect("modcp.php?action=banning", $lang->redirect_banlifted); } if($mybb->input['action'] == "do_banuser" && $mybb->request_method == "post") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); // Editing an existing ban if($mybb->input['uid']) { // Get the users info from their uid $query = $db->query(" SELECT b.*, u.uid, u.usergroup, u.additionalgroups, u.displaygroup FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}' "); $user = $db->fetch_array($query); if(!$user['uid']) { error($lang->error_invalidban); } // Permission to edit this ban? if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission(); } } // Creating a new ban else { // Get the users info from their Username $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1)); $user = $db->fetch_array($query); if(!$user['uid']) { $errors[] = $lang->invalid_username; } } if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_cannotbanself; } // Have permissions to ban this user? if(!modcp_can_manage_user($user['uid'])) { $errors[] = $lang->error_cannotbanuser; } // Check for an incoming reason if(!$mybb->input['banreason']) { $errors[] = $lang->error_nobanreason; } // Check banned group $query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'"); if(!$db->fetch_field($query, "gid")) { $errors[] = $lang->error_nobangroup; } // If this is a new ban, we check the user isn't already part of a banned group if(!$mybb->input['uid'] && $user['uid']) { $query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'"); if($db->fetch_field($query, "uid")) { $errors[] = $lang->error_useralreadybanned; } } $plugins->run_hooks("modcp_do_banuser_start"); // Still no errors? Ban the user if(!$errors) { // Ban the user if($mybb->input['liftafter'] == '---') { $lifted = 0; } else { $lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']); } if($mybb->input['uid']) { $update_array = array( 'gid' => intval($mybb->input['usergroup']), 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) ); $db->update_query('banned', $update_array, "uid='{$user['uid']}'"); } else { $insert_array = array( 'uid' => $user['uid'], 'gid' => intval($mybb->input['usergroup']), 'oldgroup' => $user['usergroup'], 'oldadditionalgroups' => $user['additionalgroups'], 'olddisplaygroup' => $user['displaygroup'], 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) ); $db->insert_query('banned', $insert_array); } // Move the user to the banned group $update_array = array( 'usergroup' => intval($mybb->input['usergroup']), 'displaygroup' => 0, 'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}"); $cache->update_banned(); log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user); $plugins->run_hooks("modcp_do_banuser_end"); if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated); } else { redirect("modcp.php?action=banning", $lang->redirect_banuser); } } // Otherwise has errors, throw back to ban page else { $mybb->input['action'] = "banuser"; } } if($mybb->input['action'] == "banuser") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning"); if($mybb->input['uid']) { add_breadcrumb($lang->mcp_nav_ban_user); } else { add_breadcrumb($lang->mcp_nav_editing_ban); } $plugins->run_hooks("modcp_banuser_start"); // If incoming user ID, we are editing a ban if($mybb->input['uid']) { $query = $db->query(" SELECT b.*, u.username, u.uid FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}' "); $banned = $db->fetch_array($query); if($banned['username']) { $username = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid']; $user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";"); } } // New ban! if(!$banuser_username) { if($mybb->input['uid']) { $user = get_user($mybb->input['uid']); $username = $user['username']; } else { $username = htmlspecialchars_uni($mybb->input['username']); } eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";"); } // Coming back to this page from an error? if($errors) { $errors = inline_error($errors); $banned = array( "bantime" => $mybb->input['liftafter'], "reason" => $mybb->input['reason'], "gid" => $mybb->input['gid'] ); $banreason = htmlspecialchars_uni($mybb->input['banreason']); } // Generate the banned times dropdown foreach($bantimes as $time => $title) { $liftlist .= "\n"; } $lift_link = "
post_code}\">{$lang->lift_ban}
'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>"; $plugins->run_hooks("modcp_banuser_end"); eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser); } if($mybb->input['action'] == "do_modnotes") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); $plugins->run_hooks("modcp_do_modnotes_start"); // Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes'] ); $cache->update("modnotes", $update_cache); $plugins->run_hooks("modcp_do_modnotes_end"); redirect("modcp.php", $lang->redirect_modnotes); } if(!$mybb->input['action']) { $query = $db->query(" SELECT COUNT(aid) AS unapprovedattachments FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE a.visible='0' {$tflist} "); $unapproved_attachments = $db->fetch_field($query, "unapprovedattachments"); if($unapproved_attachments > 0) { $query = $db->query(" SELECT t.tid, p.pid, p.uid, t.username, a.filename, a.dateuploaded FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE a.visible='0' {$tflist} ORDER BY a.dateuploaded DESC LIMIT 1 "); $attachment = $db->fetch_array($query); $attachment['date'] = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']); $attachment['time'] = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']); $attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']); $attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";"); } else { $latest_attachment = "{$lang->lastpost_never}"; } $query = $db->query(" SELECT COUNT(pid) AS unapprovedposts FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid "); $unapproved_posts = $db->fetch_field($query, "unapprovedposts"); if($unapproved_posts > 0) { $query = $db->query(" SELECT p.pid, p.tid, p.subject, p.uid, p.username, p.dateline FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid ORDER BY p.dateline DESC LIMIT 1 "); $post = $db->fetch_array($query); $post['date'] = my_date($mybb->settings['dateformat'], $post['dateline']); $post['time'] = my_date($mybb->settings['timeformat'], $post['dateline']); $post['profilelink'] = build_profile_link($post['username'], $post['uid']); $post['link'] = get_post_link($post['pid'], $post['tid']); $post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']); if(my_strlen($post['subject']) > 25) { $post['subject'] = my_substr($post['subject'], 0, 25)."..."; } $post['subject'] = htmlspecialchars_uni($post['subject']); $post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']); eval("\$latest_post = \"".$templates->get("modcp_lastpost")."\";"); } else { $latest_post = "{$lang->lastpost_never}"; } $query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}"); $unapproved_threads = $db->fetch_field($query, "unapprovedthreads"); if($unapproved_threads > 0) { $query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible=0 {$flist}",'time'] = my_date($mybb->settings['timeformat'], $thSC', 'limit' => 1)); $thread = $db->fetch_array($query); $thread['date'] = my_date($mybb->settings['dateformat'], $thread['dateline']); $thread['time'] = my_date($mybb->settings['timeformat'], $thread['dateline']); $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); $thread['link'] = get_thread_link($thread['tid']); $thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']); if(my_strlen($thread['subject']) > 25) { $post['subject'] = my_substr($thread['subject'], 0, 25)."..."; } $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']); eval("\$latest_thread = \"".$templates->get("modcp_lastthread")."\";"); } else { $latest_thread = "{$lang->lastpost_never}"; } $where = ''; if($tflist) { $where = "WHERE (t.fid <> 0 {$tflist}) OR (!l.fid)"; } $query = $db->query(" SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid) {$where} ORDER BY l.dateline DESC LIMIT 5 "); while($logitem = $db->fetch_array($query)) { $information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow(); $username = format_name($logitem['username'], $logitem['uref=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."
"; } if($logitem['fname']) { $information .= "{$lang->forum} ".htmlspecialchars_uni($logitem['fname'])."
"; } if($logitem['psubject']) { $information .= "{$lang->post} ".htmlspecialchars_uni($logitem['psubject']).""; } // Edited a user? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = unserialize($logitem['data']); if($data['uid']) { $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid'])); } } eval("\$modlogresults .= \"".$templates->get("modcp_modlogs_result")."\";"); } if(!$modlogresults) { eval("\$modlogresults = \"".$templates->get("modcp_modlogs_noresults")."\";"); } $query = $db->query(" SELECT b.*, a.username AS adminuser, u.username, (b.lifted-".TIME_NOW.") AS remaining FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."users a ON (b.admin=a.uid) WHERE b.bantime != '---' AND b.bantime != 'perm' ORDER BY remaining ASC LIMIT 5 "); // Get the banned users while($banned = $db->fetch_array($query)) { $profile_link = build_profile_link($banned['username'], $banned['uid']); // Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = ''; if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { $edit_link = "
{$lang->edit_ban} | post_code}\">{$lang->lift_ban}"; } $admin_profile = build_profile_link($banned['adminuser'], $banned['admin']); $trow = alt_trow(); if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason'])); } else { $banned['reason'] = $lang->na; } if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') { $banlength = $lang->permanent; $timeremaining = $lang->na; } else { $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['remaining']; $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false)).""; if($remaining <= 0) { $timeremaining = "({$lang->ban_ending_imminently})"; } else if($remaining < 3600) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else if($remaining < 86400) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else if($remaining < 604800) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } } eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";"); } if(!$bannedusers) { eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";"); } $modnotes = $cache->read("modnotes"); $modnotes = htmlspecialchars_uni($modnotes['modmessage']); $plugins->run_hooks("modcp_end"); eval("\$modcp = \"".$templates->get("modcp")."\";"); output_page($modcp); } ?> ed&delete={$mybb->input['uid']}&my_post_key={$mybb->post_code}\">\"{$lang-remove_from_ignore_list}\" /> {$lang->remove_from_ignore_list}"; } else { $buddy_options .= "
post_code}\">\"{$lang-add_to_ignore_list}\" /> {$lang->add_to_ignore_list}"; } } $plugins->run_hooks("member_profile_end"); eval("\$profile = \"".$templates->get("member_profile")."\";"); output_page($profile); } if($mybb->input['action'] == "do_emailuser" && $mybb->request_method == "post") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); $plugins->run_hooks("member_do_emailuser_start"); // Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid']) { error_no_permission(); } // Check group limits if($mybb->usergroup['maxemails'] > 0) { $query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "fromuid='{$mybb->user['uid']}' AND dateline >= '".(TIME_NOW - (60*60*24))."'"); $sent_count = $db->fetch_field($query, "sent_count"); if($sent_count >= $mybb->usergroup['maxemails']) { $lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']); error($lang->error_max_emails_day); } } $query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".intval($mybb->input['uid'])."'"); $to_user = $db->fetch_array($query); if(!$to_user['username']) { error($lang->error_invalidusername); } if($to_user['hideemail'] != 0) { error($lang->error_hideemail); } if(empty($mybb->input['subject'])) { $errors[] = $lang->error_no_email_subject; } if(empty($mybb->input['message'])) { $errors[] = $lang->error_no_email_message; } if(count($errors) == 0) { if($mybb->settings['mail_handler'] == 'smtp') { $from = $mybb->user['email']; } else { $from = "{$mybb->user['username']} <{$mybb->user['email']}>"; } $message = $lang->sprintf($lang->email_emailuser, $to_user['username'], $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->input['message']); my_mail($to_user['email'], $mybb->input['subject'], $message, $from, "", "", false, "text", "", $mybb->user['email']); if($mybb->settings['mail_logging'] > 0) { // Log the message $log_entry = array( "subject" => $db->escape_string($mybb->input['subject']), "message" => $db->escape_string($mybb->input['message']), "dateline" => TIME_NOW, "fromuid" => $mybb->user['uid'], "fromemail" => $db->escape_string($mybb->user['email']), "touid" => $to_user['uid'], "toemail" => $db->escape_string($to_user['email']), "tid" => 0, "ipaddress" => $db->escape_string($session->ipaddress) ); $db->insert_query("maillogs", $log_entry); } $plugins->run_hooks("member_do_emailuser_end"); redirect(get_profile_link($to_user['uid']), $lang->redirect_emailsent); } else { $mybb->input['action'] = "emailuser"; } } if($mybb->input['action'] == "emailuser") { $plugins->run_hooks("member_emailuser_start"); // Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid']) { error_no_permission(); } // Check group limits if($mybb->usergroup['maxemails'] > 0) { $query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "fromuid='{$mybb->user['uid']}' AND dateline >= '".(TIME_NOW - (60*60*24))."'"); $sent_count = $db->fetch_field($query, "sent_count"); if($sent_count > $mybb->usergroup['maxemails']) { $lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']); error($lang->error_max_emails_day); } } $query = $db->simple_select("users", "uid, username, email, hideemail, ignorelist", "uid='".intval($mybb->input['uid'])."'"); $to_user = $db->fetch_array($query); $lang->email_user = $lang->sprintf($lang->email_user, $to_user['username']); if(!$to_user['uid']) { error($lang->error_invaliduser); } if($to_user['hideemail'] != 0) { error($lang->error_hideemail); } if($to_user['ignorelist'] && (my_strpos(",".$to_user['ignorelist'].",", ",".$mybb->user['uid'].",") !== false && $mybb->usergroup['cansendemailoverride'] != 1)) { error_no_permission(); } if(count($errors) > 0) { $errors = inline_error($errors); $subject = htmlspecialchars_uni($mybb->input['subject']); $message = htmlspecialchars_uni($mybb->input['message']); } else { $errors = ''; $subject = ''; $message = ''; } $plugins->run_hooks("member_emailuser_end"); eval("\$emailuser = \"".$templates->get("member_emailuser")."\";"); output_page($emailuser); } if(!$mybb->input['action']) { header("Location: index.php"); } ?> run_hooks("member_emailuser_end"); eval("\$emailuser = \"".$templates->get("member_emailuser")."\";"); output_page($emailuser); } if(!$mybb->input['action']) { header("Location: index.php"); } ?> $lifted = 0; } else { $lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']); } if($mybb->input['uid']) { $update_array = array( 'gid' => intval($mybb->input['usergroup']), 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) ); $db->update_query('banned', $update_array, "uid='{$user['uid']}'"); } else { $insert_array = array( 'uid' => $user['uid'], 'gid' => intval($mybb->input['usergroup']), 'oldgroup' => $user['usergroup'], 'oldadditionalgroups' => $user['additionalgroups'], 'olddisplaygroup' => $user['displaygroup'], 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['liftafter']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['banreason']) ); $db->insert_query('banned', $insert_array); } // Move the user to the banned group $update_array = array( 'usergroup' => intval($mybb->input['usergroup']), 'displaygroup' => 0, 'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}"); $cache->update_banned(); log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user); $plugins->run_hooks("modcp_do_banuser_end"); if($mybb->input['uid']) { redirect("modcp.php?action=banning", $lang->redirect_banuser_updated); } else { redirect("modcp.php?action=banning", $lang->redirect_banuser); } } // Otherwise has errors, throw back to ban page else { $mybb->input['action'] = "banuser"; } } if($mybb->input['action'] == "banuser") { add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning"); if($mybb->input['uid']) { add_breadcrumb($lang->mcp_nav_ban_user); } else { add_breadcrumb($lang->mcp_nav_editing_ban); } $plugins->run_hooks("modcp_banuser_start"); // If incoming user ID, we are editing a ban if($mybb->input['uid']) { $query = $db->query(" SELECT b.*, u.username, u.uid FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}' "); $banned = $db->fetch_array($query); if($banned['username']) { $username = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']); $uid = $mybb->input['uid']; $user = get_user($banned['uid']); $lang->ban_user = $lang->edit_ban; // Swap over lang variables eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";"); } } // New ban! if(!$banuser_username) { if($mybb->input['uid']) { $user = get_user($mybb->input['uid']); $username = $user['username']; } else { $username = htmlspecialchars_uni($mybb->input['username']); } eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";"); } // Coming back to this page from an error? if($errors) { $errors = inline_error($errors); $banned = array( "bantime" => $mybb->input['liftafter'], "reason" => $mybb->input['reason'], "gid" => $mybb->input['gid'] ); $banreason = htmlspecialchars_uni($mybb->input['banreason']); } // Generate the banned times dropdown foreach($bantimes as $time => $title) { $liftlist .= "\n"; } $lift_link = "
post_code}\">{$lang->lift_ban}
'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>'; echo "\n"; ?>"; $plugins->run_hooks("modcp_banuser_end"); eval("\$banuser = \"".$templates->get("modcp_banuser")."\";"); output_page($banuser); } if($mybb->input['action'] == "do_modnotes") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']); $plugins->run_hooks("modcp_do_modnotes_start"); // Update Moderator Notes cache $update_cache = array( "modmessage" => $mybb->input['modnotes'] ); $cache->update("modnotes", $update_cache); $plugins->run_hooks("modcp_do_modnotes_end"); redirect("modcp.php", $lang->redirect_modnotes); } if(!$mybb->input['action']) { $query = $db->query(" SELECT COUNT(aid) AS unapprovedattachments FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE a.visible='0' {$tflist} "); $unapproved_attachments = $db->fetch_field($query, "unapprovedattachments"); if($unapproved_attachments > 0) { $query = $db->query(" SELECT t.tid, p.pid, p.uid, t.username, a.filename, a.dateuploaded FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE a.visible='0' {$tflist} ORDER BY a.dateuploaded DESC LIMIT 1 "); $attachment = $db->fetch_array($query); $attachment['date'] = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']); $attachment['time'] = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']); $attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']); $attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";"); } else { $latest_attachment = "{$lang->lastpost_never}"; } $query = $db->query(" SELECT COUNT(pid) AS unapprovedposts FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid "); $unapproved_posts = $db->fetch_field($query, "unapprovedposts"); if($unapproved_posts > 0) { $query = $db->query(" SELECT p.pid, p.tid, p.subject, p.uid, p.username, p.dateline FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid ORDER BY p.dateline DESC LIMIT 1 "); $post = $db->fetch_array($query); $post['date'] = my_date($mybb->settings['dateformat'], $post['dateline']); $post['time'] = my_date($mybb->settings['timeformat'], $post['dateline']); $post['profilelink'] = build_profile_link($post['username'], $post['uid']); $post['link'] = get_post_link($post['pid'], $post['tid']); $post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']); if(my_strlen($post['subject']) > 25) { $post['subject'] = my_substr($post['subject'], 0, 25)."..."; } $post['subject'] = htmlspecialchars_uni($post['subject']); $post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']); eval("\$latest_post = \"".$templates->get("modcp_lastpost")."\";"); } else { $latest_post = "{$lang->lastpost_never}"; } $query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}"); $unapproved_threads = $db->fetch_field($query, "unapprovedthreads"); if($unapproved_threads > 0) { $query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible=0 {$flist}",'time'] = my_date($mybb->settings['timeformat'], $thSC', 'limit' => 1)); $thread = $db->fetch_array($query); $thread['date'] = my_date($mybb->settings['dateformat'], $thread['dateline']); $thread['time'] = my_date($mybb->settings['timeformat'], $thread['dateline']); $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']); $thread['link'] = get_thread_link($thread['tid']); $thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']); if(my_strlen($thread['subject']) > 25) { $post['subject'] = my_substr($thread['subject'], 0, 25)."..."; } $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']); eval("\$latest_thread = \"".$templates->get("modcp_lastthread")."\";"); } else { $latest_thread = "{$lang->lastpost_never}"; } $where = ''; if($tflist) { $where = "WHERE (t.fid <> 0 {$tflist}) OR (!l.fid)"; } $query = $db->query(" SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid) {$where} ORDER BY l.dateline DESC LIMIT 5 "); while($logitem = $db->fetch_array($query)) { $information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']); $trow = alt_trow(); $username = format_name($logitem['username'], $logitem['uref=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."
"; } if($logitem['fname']) { $information .= "{$lang->forum} ".htmlspecialchars_uni($logitem['fname'])."
"; } if($logitem['psubject']) { $information .= "{$lang->post} ".htmlspecialchars_uni($logitem['psubject']).""; } // Edited a user? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = unserialize($logitem['dattemplates->get("modcp_modlogs_result")."\";"); } if(!$modlogresults) { eval("\$modlogresults = \"".$templates->get("modcp_modlogs_noresults")."\";"); } $query = $db->query(" SELECT b.LE_PREFIX."users a ON (b.admin=a.uid) WHERE b.bantime != '---' AND b.bantime != 'perm' ORDER BY remaining ASC LIMIT 5 "); // Get the banned users while($banned = $db->fetch_array($query)) { $profile_link = build_profile_link($banned['username'], $banned['uid']); // Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = ''; if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) { $edit_link = "
{$lang->edit_ban} | post_code}\">{$lang->lift_ban}"; } $admin_profile = build_profile_link($banned['adminuser'], $banned['admin']); $trow = alt_trow(); if($banned['reason']) { $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason'])); } else { $banned['reason'] = $lang->na; } if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') { $banlength = $lang->permanent; $timeremaining = $lang->na; } else { $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['remaining']; $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false)).""; if($remaining <= 0) { $timeremaining = "({$lang->ban_ending_imminently})"; } else if($remaining < 3600) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else if($remaining < 86400) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else if($remaining < 604800) { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } else { $timeremaining = "({$timeremaining} {$lang->ban_remaining})"; } } eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";"); } if(!$bannedusers) { eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";"); } $modnotes = $cache->read("modnotes"); $modnotes = htmlspecialchars_uni($modnotes['modmessage']); $plugins->run_hooks("modcp_end"); eval("\$modcp = \"".$templates->get("modcp")."\";"); output_page($modcp); } ?> ."\";"); } if(!$bannedusers) { eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";"); } $modnotes = $cache->read("modnotes"); $modnotes = htmlspecialchars_uni($modnotes['modmessage']); $plugins->run_hooks("modcp_end"); eval("\$modcp = \"".$templates->get("modcp")."\";"); output_page($modcp); } ?> rl = 'profile.php?' . $vbulletin->session->vars['sessionurl'] . 'do=editsignature#sigpic'; eval(print_standard_redirect('redirect_updatethanks')); } // ############################ start edit signature ########################## if ($_REQUEST['do'] == 'editsignature') { require_once(DIR . '/includes/functions_newpost.php'); if (!($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusesignature'])) { eval(standard_error(fetch_error('nosignaturepermission'))); } ($hook = vBulletinHook::fetch_hook('profile_editsignature_start')) ? eval($hook) : false; // Build the permissions to display require_once(DIR . '/includes/class_bbcode.php'); require_once(DIR . '/includes/class_sigparser.php'); // Create the parser with the users sig permissions $sig_parser = new vB_SignatureParser($vbulletin, fetch_tag_list(), $vbulletin->userinfo['permissions'], $vbulletin->userinfo['userid']); // Build $show variables for each signature bitfield permission foreach ($vbulletin->bf_ugp_signaturepermissions AS $bit_name => $bit_value) { if ($bbcode = preg_match('#canbbcode(\w+)#i', $bit_name, $matches) AND $matches[1] AND $matches[1] != 'quote') { $term = $matches[1] == 'link' ? 'URL' : strtoupper($matches[1]); $show["$bit_name"] = ($permissions['signaturepermissions'] & $bit_value AND $vbulletin->options['allowedbbcodes'] & @constant('ALLOW_BBCODE_' . $term)) ? true : false; } else { $show["$bit_name"] = ($permissions['signaturepermissions'] & $bit_value ? true : false); } } // Build variables for the remaining signature permissions $sigperms_display = array( 'sigmaxchars' => vb_number_format($permissions['maxchars']), 'sigmaxlines' => vb_number_format($permissions['maxlines']), 'sigpicmaxwidth' => vb_number_format($permissions['sigpicmaxwidth']), 'sigpicmaxheight' => vb_number_format($permissions['sigpicmaxheight']), 'sigpicmaxsize' => vb_number_format($permissions['sigpicmaxsize'], 1, true) ); if ($preview_error_signature) { $signature = $preview_error_signature; } else { $signature = $vbulletin->userinfo['signature']; } // Free the memory, unless we need it below. if (!$signature) { unset($sig_parser); } if ($signature) { if (!$previewmessage) { require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); $bbcode_parser->set_parse_userinfo(fetch_userinfo($vbulletin->userinfo['userid'], FETCH_USERINFO_SIGPIC), $vbulletin->userinfo['permissions']); $previewmessage = $bbcode_parser->parse($signature, 'signature'); } // save a conditional by just overwriting the phrase $vbphrase['submit_message'] =& $vbphrase['save_signature']; eval('$preview = "' . fetch_template('newpost_preview') . '";'); } require_once(DIR . '/includes/functions_editor.php'); // set message box width to usercp size $stylevar['messagewidth'] = $stylevar['messagewidth_usercp']; $editorid = construct_edit_toolbar( htmlspecialchars_uni($signature), 0, 'signature', $vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['allowsmilies'] ); $show['canbbcode'] = ($vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['canbbcode']) ? true : false; // ############### DISPLAY SIG IMAGE CONTROLS ############### require_once(DIR . '/includes/functions_file.php'); $inimaxattach = fetch_max_upload_size(); if ($permissions['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['cansigpic']) { $show['cansigpic'] = true; $show['sigpic_url'] = (ini_get('allow_url_fopen') != 0 OR function_exists('curl_init')); $maxnote = ''; if ($permissions['sigpicmaxsize'] AND ($permissions['sigpicmaxwidth'] OR $permissions['sigpicmaxheight'])) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_or_z'], $sigperms_display['sigpicmaxwidth'], $sigperms_display['sigpicmaxheight'], $sigperms_display['sigpicmaxsize']); } else if ($permissions['sigpicmaxsize']) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x'], $sigperms_display['sigpicmaxsize']); } else if ($permissions['sigpicmaxwidth'] OR $permissions['sigpicmaxheight']) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_pixels'], $sigperms_display['sigpicmaxwidth'], $sigperms_display['sigpicmaxheight']); } $show['maxnote'] = (!empty($maxnote)) ? true : false; // Get the current sig image info. if ($sig_image = $db->query_first("SELECT dateline, filename, filedata FROM " . TABLE_PREFIX . "sigpic WHERE userid = " . $vbulletin->userinfo['userid'])) { if ($sig_image['filedata'] != '') { // sigpic stored in the DB $sigpicurl = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'type=sigpic&userid=' . $vbulletin->userinfo['userid'] . "&dateline=$sig_image[dateline]"; } else { // sigpic stored in the FS $sigpicurl = $vbulletin->options['sigpicurl'] . '/sigpic' . $vbulletin->userinfo['userid'] . '_' . $vbulletin->userinfo['sigpicrevision'] . '.gif'; } } else // No sigpic yet { $sigpicurl = false; } } else { $show['cansigpic'] = false; } construct_usercp_nav('signature'); $navbits[''] = $vbphrase['edit_signature']; $templatename = 'modifysignature'; $url =& $vbulletin->url; } // ############################################################################ // ############################### EDIT AVATAR ################################ // ############################################################################ if ($_REQUEST['do'] == 'editavatar') { $vbulletin->input->clean_array_gpc('r', array( 'pagenumber' => TYPE_UINT, 'categoryid' => TYPE_UINT )); if (!$vbulletin->options['avatarenabled']) { eval(standard_error(fetch_error('avatardisabled'))); } ($hook = vBulletinHook::fetch_hook('profile_editavatar_start')) ? eval($hook) : false; // initialise vars $avatarchecked["{$vbulletin->userinfo['avatarid']}"] = 'checked="checked"'; $categorycache = array(); $bbavatar = array(); $donefirstcategory = 0; // variables that will become templates $avatarlist = ''; $nouseavatarchecked = ''; $categorybits = ''; $predefined_section = ''; $custom_section = ''; // initialise the bg class $bgclass = 'alt1'; // ############### DISPLAY USER'S AVATAR ############### if ($vbulletin->userinfo['avatarid']) { // using a predefined avatar $avatar = $db->query_first_slave("SELECT * FROM " . TABLE_PREFIX . "avatar WHERE avatarid = " . $vbulletin->userinfo['avatarid']); $avatarid =& $avatar['avatarid']; eval('$currentavatar = "' . fetch_template('modifyavatarbit') . '";'); // store avatar info in $bbavatar for later use $bbavatar = $avatar; } else { // not using a predefined avatar, check for custom if ($avatar = $db->query_first("SELECT dateline, width, height FROM " . TABLE_PREFIX . "customavatar WHERE userid=" . $vbulletin->userinfo['userid'])) { // using a custom avatar if ($vbulletin->options['usefileavatar']) { $vbulletin->userinfo['avatarurl'] = $vbulletin->options['avatarurl'] . '/avatar' . $vbulletin->userinfo['userid'] . '_' . $vbulletin->userinfo['avatarrevision'] . '.gif'; } else { $vbulletin->userinfo['avatarurl'] = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $vbulletin->userinfo['userid'] . "&dateline=$avatar[dateline]"; } if ($avatar['width'] AND $avatar['height']) { $vbulletin->userinfo['avatarurl'] .= "\" width=\"$avatar[width]\" height=\"$avatar[height]"; } eval('$currentavatar = "' . fetch_template('modifyavatarbit_custom') . '";'); } else { // no avatar specified $nouseavatarchecked = 'checked="checked"'; $avatarchecked[0] = ''; eval('$currentavatar = "' . fetch_template('modifyavatarbit_noavatar') . '";'); } } // get rid of any lingering $avatar variables unset($avatar); $categorycache =& fetch_avatar_categories($vbulletin->userinfo); foreach ($categorycache AS $category) { if (!$donefirstcategory OR $category['imagecategoryid'] == $vbulletin->GPC['categoryid']) { $displaycategory = $category; $donefirstcategory = 1; } } // get the id of the avatar category we want to display if ($vbulletin->GPC['categoryid'] == 0) { if ($vbulletin->userinfo['avatarid'] != 0 AND !empty($categorycache["{$bbavatar['imagecategoryid']}"])) { $displaycategory = $bbavatar; } $vbulletin->GPC['categoryid'] = $displaycategory['imagecategoryid']; } // make the category