Jump to content

doa24uk

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by doa24uk

  1. Also, does this coding use a database that is hosted on one server but not the other? You'll need to look at error logs (as mentioned above) and try and narrow the issue down, then provide code if you can't see the errors.
  2. No, but there are usually bridges or converters for the most common forum solutions ... since I haven't heard of ccBoard I can't tell you if there's a converter available. Otherwise it's a case of matching up all the mysql field names and altering them to use phpbb's field names instead. Ask across at phpbb.com would be my best advice.
  3. doa24uk

    tax..

    Which country are you in? Surely it's simply a case of taking totals and calculating percentage markups to include the tax at the prevailing rate for your country??
  4. The original (array) code is from SMF (Simple Machines Forum) & they use the $1 variable just fine... I should probably point out that this array is actually inside another array... Here's the entire code to hopefully make it clearer. /* The following bbc are formatted as an array, with keys as follows: tag: the tag's name - should be lowercase! type: one of... - (missing): [tag]parsed content[/tag] - unparsed_equals: [tag=xyz]parsed content[/tag] - parsed_equals: [tag=parsed data]parsed content[/tag] - unparsed_content: [tag]unparsed content[/tag] - closed: [tag], [tag/], [tag /] - unparsed_commas: [tag=1,2,3]parsed content[/tag] - unparsed_commas_content: [tag=1,2,3]unparsed content[/tag] - unparsed_equals_content: [tag=...]unparsed content[/tag] parameters: an optional array of parameters, for the form [tag abc=123]content[/tag]. The array is an associative array where the keys are the parameter names, and the values are an array which may contain the following: - match: a regular expression to validate and match the value. - quoted: true if the value should be quoted. - validate: callback to evaluate on the data, which is $data. - value: a string in which to replace $1 with the data. either it or validate may be used, not both. - optional: true if the parameter is optional. test: a regular expression to test immediately after the tag's '=', ' ' or ']'. Typically, should have a \] at the end. Optional. content: only available for unparsed_content, closed, unparsed_commas_content, and unparsed_equals_content. $1 is replaced with the content of the tag. Parameters are repalced in the form {param}. For unparsed_commas_content, $2, $3, ..., $n are replaced. before: only when content is not used, to go before any content. For unparsed_equals, $1 is replaced with the value. For unparsed_commas, $1, $2, ..., $n are replaced. after: similar to before in every way, except that it is used when the tag is closed. disabled_content: used in place of content when the tag is disabled. For closed, default is '', otherwise it is '$1' if block_level is false, '<div>$1</div>' elsewise. disabled_before: used in place of before when disabled. Defaults to '<div>' if block_level, '' if not. disabled_after: used in place of after when disabled. Defaults to '</div>' if block_level, '' if not. block_level: set to true the tag is a "block level" tag, similar to HTML. Block level tags cannot be nested inside tags that are not block level, and will not be implicitly closed as easily. One break following a block level tag may also be removed. trim: if set, and 'inside' whitespace after the begin tag will be removed. If set to 'outside', whitespace after the end tag will meet the same fate. validate: except when type is missing or 'closed', a callback to validate the data as $data. Depending on the tag's type, $data may be a string or an array of strings (corresponding to the replacement.) quoted: when type is 'unparsed_equals' or 'parsed_equals' only, may be not set, 'optional', or 'required' corresponding to if the content may be quoted. This allows the parser to read [tag="abc]def[esdf]"] properly. require_parents: an array of tag names, or not set. If set, the enclosing tag *must* be one of the listed tags, or parsing won't occur. require_children: similar to require_parents, if set children won't be parsed if they are not in the list. disallow_children: similar to, but very different from, require_children, if it is set the listed tags will not be parsed inside the tag. */ $codes = array( array( 'tag' => 'code', 'type' => 'unparsed_content', 'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;"> $1</pre>' : '$1') . '</div>', // !!! Maybe this can be simplified? 'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', ' global $context; if (!isset($disabled[\'code\'])) { $php_parts = preg_split(\'~(<\?php|\?>)~\', $data, -1, PREG_SPLIT_DELIM_CAPTURE); for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++) { // Do PHP code coloring? if ($php_parts[$php_i] != \'<?php\') continue; $php_string = \'\'; while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != \'?>\') { $php_string .= $php_parts[$php_i]; $php_parts[$php_i++] = \'\'; } $php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]); } // Fix the PHP code stuff... $data = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode(\'\', $php_parts)); // Older browsers are annoying, aren\'t they? if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\']) $data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data); elseif (!$context[\'browser\'][\'is_gecko\']) $data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data); }'), 'block_level' => true, ), array( 'tag' => 'code', 'type' => 'unparsed_equals_content', 'content' => '<div class="codeheader">' . $txt['smf238'] . ': ($2)</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>', // !!! Maybe this can be simplified? 'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', ' global $context; if (!isset($disabled[\'code\'])) { $php_parts = preg_split(\'~(<\?php|\?>)~\', $data[0], -1, PREG_SPLIT_DELIM_CAPTURE); for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++) { // Do PHP code coloring? if ($php_parts[$php_i] != \'<?php\') continue; $php_string = \'\'; while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != \'?>\') { $php_string .= $php_parts[$php_i]; $php_parts[$php_i++] = \'\'; } $php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]); } // Fix the PHP code stuff... $data[0] = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode(\'\', $php_parts)); // Older browsers are annoying, aren\'t they? if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\']) $data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data); elseif (!$context[\'browser\'][\'is_gecko\']) $data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data); }'), 'block_level' => true, ), // END SECTION I'M INTERESTED IN // I'VE LEFT THE FOLLOWING IN TO SHOW HOW OTHER arrays USE $1 as a VARIABLE, SO //THE FOREACH LOOP MUST GO AROUND THE STUFF ABOVE & NOT ALL OF IT. array( 'tag' => 'color', 'type' => 'unparsed_equals', 'test' => '(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,12})\]', 'before' => '<span style="color: $1;">', 'after' => '</span>', ), array( 'tag' => 'email', 'type' => 'unparsed_content', 'content' => '<a href="mailto:$1">$1</a>', // !!! Should this respect guest_hideContacts? 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'), ), array( 'tag' => 'email', 'type' => 'unparsed_equals', 'before' => '<a href="mailto:$1">', 'after' => '</a>', // !!! Should this respect guest_hideContacts? 'disallow_children' => array('email', 'ftp', 'url', 'iurl'), 'disabled_after' => ' ($1)', ), array( 'tag' => 'size', 'type' => 'unparsed_equals', 'test' => '[1-9]\]', // !!! line-height 'before' => '<font size="$1" style="line-height: 1.3em;">', 'after' => '</font>', ), array( 'tag' => 'time', 'type' => 'unparsed_content', 'content' => '$1', 'validate' => create_function('&$tag, &$data, $disabled', ' if (is_numeric($data)) $data = timeformat($data); else $tag[\'content\'] = \'[time]$1[/time]\';'), ), );
  5. Hi guys. Here's the code array( 'tag' => 'code', 'type' => 'unparsed_content', 'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;"> $1</pre>' : '$1') . '</div>', ), And what I want to do is explode $1 & add something to the end of it (a new variable. eg. $1 - $2 So here's my explode code, I'm getting errors wherever I place it. $2 = ''; $codeChunks = explode("\n", $1); foreach($codeChunks as $i => $chunk) { $2 .= "$chunk - <b><a href='http://mysite.com?id=$chunk' target='_blank'>Hyperlink</a></b>\n"; } So hopefully I end up with an output like this .... 1 - [url=http://mysite.com?id=1]Hyperlink[/url] 2 - [url=http://mysite.com?id=2]Hyperlink[/url] 3 - [url=http://mysite.com?id=3]Hyperlink[/url] 4 - [url=http://mysite.com?id=4]Hyperlink[/url] 5 - [url=http://mysite.com?id=5]Hyperlink[/url]
  6. I thought it would be something like that (not being in a useful form) but don't know JS that well. Good news is that your code did the trick! Many thanks
  7. Hi guys, This works perfectly .... var mySplit = "123456789"; var mySplitResult = url.split("5"); window.open('http://none.com/mypage.php?id=' + mySplitResult[0], 'window name') So why doesn't this ?? (presume the selected text is "123456789" - same as the above example) --> var focusedWindow = document.commandDispatcher.focusedWindow; if (focusedWindow == window) focusedWindow = getBrowser().contentWindow; var url = focusedWindow.getSelection(); var mySplitResult = url.split("5"); window.open('http://mirrorchecker.com/linkchecker2.php?url=' + mySplitResult[0], 'window name')
  8. How many emails (roughly) are you sending per hour. Also, an important question is where are you sending them from - home or your webserver? (As JamesThePanda asked). If you're sending from php / your webserver then get in touch with your hosting company and tell them the mail server allocated to your account has been blacklisted. They will be able to lodge the proper paperwork / procedure to get it un-blacklisted. Also, does it happen with ALL email accounts or only email to certain domains (ie. Hotmail)???
  9. Hi, Google is your mate I'd utilise something like this to get wordpress & SMF running in Sync, then alter your custom CMS to use the login mysql database (whichever one you choose as the master DB). I suggest doing it this way because if you coded the CMS, you'll know exactly what files to edit that deal with Mysql user detail lookups
  10. <?php $OSList = array ( // Match user agent string with operating systems 'Windows 3.11' => 'Win16', 'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', 'Windows 98' => '(Windows 98)|(Win98)', 'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)', 'Windows XP' => '(Windows NT 5.1)|(Windows XP)', 'Windows Server 2003' => '(Windows NT 5.2)', 'Windows Vista' => '(Windows NT 6.0)', 'Windows 7' => '(Windows NT 7.0)', 'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)', 'Windows ME' => 'Windows ME', 'Open BSD' => 'OpenBSD', 'Sun OS' => 'SunOS', 'Linux' => '(Linux)|(X11)', 'Mac OS' => '(Mac_PowerPC)|(Macintosh)', 'QNX' => 'QNX', 'BeOS' => 'BeOS', 'OS/2' => 'OS/2', 'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)' ); // Loop through the array of user agents and matching operating systems foreach($OSList as $CurrOS=>$Match) { // Find a match if (eregi($Match, $_SERVER['HTTP_USER_AGENT'])) { // We found the correct match break; } } // You are using ... echo "You are using ".$CurrOS; class Browser { private $_agent = ''; private $_browser_name = ''; private $_version = ''; private $_platform = ''; private $_os = ''; private $_is_aol = false; private $_aol_version = ''; const BROWSER_UNKNOWN = 'unknown'; const VERSION_UNKNOWN = 'unknown'; const BROWSER_OPERA = 'Opera'; const BROWSER_WEBTV = 'WebTV'; const BROWSER_NETPOSITIVE = 'NetPositive'; const BROWSER_IE = 'Internet Explorer'; const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; const BROWSER_GALEON = 'Galeon'; const BROWSER_KONQUEROR = 'Konqueror'; const BROWSER_ICAB = 'iCab'; const BROWSER_OMNIWEB = 'OmniWeb'; const BROWSER_PHOENIX = 'Phoenix'; const BROWSER_FIREBIRD = 'Firebird'; const BROWSER_FIREFOX = 'Firefox'; const BROWSER_MOZILLA = 'Mozilla'; const BROWSER_AMAYA = 'Amaya'; const BROWSER_LYNX = 'Lynx'; const BROWSER_SAFARI = 'Safari'; const BROWSER_IPHONE = 'iPhone'; const BROWSER_IPOD = 'iPod'; const BROWSER_CHROME = 'Chrome'; const BROWSER_ANDROID = 'Android'; const BROWSER_GOOGLEBOT = 'GoogleBot'; const BROWSER_SLURP = 'Yahoo! Slurp'; const BROWSER_W3CVALIDATOR = 'W3C Validator'; const PLATFORM_UNKNOWN = 'unknown'; const PLATFORM_WINDOWS = 'Windows'; const PLATFORM_WINDOWS_CE = 'Windows CE'; const PLATFORM_APPLE = 'Apple'; const PLATFORM_LINUX = 'Linux'; const PLATFORM_OS2 = 'OS/2'; const PLATFORM_BEOS = 'BeOS'; const PLATFORM_IPHONE = 'iPhone'; const PLATFORM_IPOD = 'iPod'; const OPERATING_SYSTEM_UNKNOWN = 'unknown'; public function __construct() { $this->reset(); $this->determine(); } /** * Reset all properties */ public function reset() { $this->_agent = $_SERVER['HTTP_USER_AGENT']; $this->_browser_name = self::BROWSER_UNKNOWN; $this->_version = self::VERSION_UNKNOWN; $this->_platform = self::PLATFORM_UNKNOWN; $this->_os = self::OPERATING_SYSTEM_UNKNOWN; $this->_is_aol = false; $this->_aol_version = self::VERSION_UNKNOWN; } /** * Check to see if the specific browser is valid * @param string $browserName * @return True if the browser is the specified browser */ function isBrowser($browserName) { return( 0 == strcasecmp($this->_browser_name, trim($browserName))); } /** * The name of the browser. All return types are from the class contants * @return string Name of the browser */ public function getBrowser() { return $this->_browser_name; } /** * Set the name of the browser * @param $browser The name of the Browser */ public function setBrowser($browser) { return $this->_browser_name = $browser; } /** * The name of the platform. All return types are from the class contants * @return string Name of the browser */ public function getPlatform() { return $this->_platform; } /** * Set the name of the platform * @param $platform The name of the Platform */ public function setPlatform($platform) { return $this->_platform = $platform; } /** * The version of the browser. * @return string Version of the browser (will only contain alpha-numeric characters and a period) */ public function getVersion() { return $this->_version; } /** * Set the version of the browser * @param $version The version of the Browser */ public function setVersion($version) { $this->_version = ereg_replace('[^0-9,.,a-z,A-Z]','',$version); } /** * The version of AOL. * @return string Version of AOL (will only contain alpha-numeric characters and a period) */ public function getAolVersion() { return $this->_aol_version; } /** * Set the version of AOL * @param $version The version of AOL */ public function setAolVersion($version) { $this->_aol_version = ereg_replace('[^0-9,.,a-z,A-Z]','',$version); } /** * Is the browser from AOL? * @return boolean True if the browser is from AOL otherwise false */ public function isAol() { return $this->_is_aol; } /** * Set the browser to be from AOL * @param $isAol */ public function setAol($isAol) { $this->_is_aol = $isAol; } /** * Get the user agent value in use to determine the browser * @return string The user agent from the HTTP header */ public function getUserAgent() { return $this->_agent; } /** * Set the user agent value (the construction will use the HTTP header value - this will overwrite it) * @param $agent_string The value for the User Agent */ public function setUserAgent($agent_string) { $this->reset(); $this->_agent = $agent_string; $this->determine(); } /** * Protected routine to calculate and determine what the browser is in use (including platform) */ protected function determine() { $this->checkPlatform(); $this->checkBrowsers(); $this->checkForAol(); } /** * Protected routine to determine the browser type * @return boolean True if the browser was detected otherwise false */ protected function checkBrowsers() { return ( $this->checkBrowserGoogleBot() || $this->checkBrowserSlurp() || $this->checkBrowserInternetExplorer() || $this->checkBrowserFirefox() || $this->checkBrowserChrome() || $this->checkBrowserAndroid() || $this->checkBrowserSafari() || $this->checkBrowserOpera() || $this->checkBrowserNetPositive() || $this->checkBrowserFirebird() || $this->checkBrowserGaleon() || $this->checkBrowserKonqueror() || $this->checkBrowserIcab() || $this->checkBrowserOmniWeb() || $this->checkBrowserPhoenix() || $this->checkBrowserWebTv() || $this->checkBrowserAmaya() || $this->checkBrowserLynx() || $this->checkBrowseriPhone() || $this->checkBrowseriPod() || $this->checkBrowserW3CValidator() || $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */ ); } /** * Determine if the user is using an AOL User Agent * @return boolean True if the browser is from AOL otherwise false */ protected function checkForAol() { $retval = false; if( eregi("AOL", $this->_agent) ) { $aversion = explode(' ',stristr($this->_agent, "AOL")); $this->setAol(true); $this->setAolVersion(ereg_replace("[^0-9,.,a-z,A-Z]", "", $aversion[1])); $retval = true; } else { $this->setAol(false); $this->setAolVersion(self::VERSION_UNKNOWN); $retval = true; } return $retval; } /** * Determine if the browser is the GoogleBot or not * @return boolean True if the browser is the GoogletBot otherwise false */ protected function checkBrowserGoogleBot() { $retval = false; if( eregi('googlebot',$this->_agent) ) { $aresult = explode("/",stristr($this->_agent,"googlebot")); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_GOOGLEBOT; $retval = true; } return $retval; } /** * Determine if the browser is the W3C Validator or not * @return boolean True if the browser is the W3C Validator otherwise false */ protected function checkBrowserW3CValidator() { $retval = false; if( eregi('W3C-checklink',$this->_agent) ) { $aresult = explode("/",stristr($this->_agent,"W3C-checklink")); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_W3CVALIDATOR; $retval = true; } return $retval; } /** * Determine if the browser is the W3C Validator or not * @return boolean True if the browser is the W3C Validator otherwise false */ protected function checkBrowserSlurp() { $retval = false; if( eregi('Slurp',$this->_agent) ) { $aresult = explode("/",stristr($this->_agent,"Slurp")); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_SLURP; $retval = true; } return $retval; } /** * Determine if the browser is Internet Explorer or not * @return boolean True if the browser is Internet Explorer otherwise false */ protected function checkBrowserInternetExplorer() { $retval = false; // Test for v1 - v1.5 IE if( eregi('microsoft internet explorer', $this->_agent) ) { $this->setBrowser(self::BROWSER_IE); $this->setVersion('1.0'); $aresult = stristr($this->_agent, '/'); if( ereg('308|425|426|474|0b1', $aresult) ) { $this->setVersion('1.5'); } $retval = true; } // Test for versions > 1.5 else if( eregi('msie',$this->_agent) && !eregi('opera',$this->_agent) ) { $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'msie')); $this->setBrowser( self::BROWSER_IE ); $this->setVersion($aresult[1]); $retval = true; } // Test for Pocket IE else if( eregi('mspie',$this->_agent) || eregi('pocket', $this->_agent) ) { $aresult = explode(' ',stristr($this->_agent,'mspie')); $this->setPlatform( self::PLATFORM_WINDOWS_CE ); $this->setBrowser( self::BROWSER_POCKET_IE ); if( eregi('mspie', $this->_agent) ) { $this->setVersion($aresult[1]); } else { $aversion = explode('/',$this->_agent); $this->setVersion($aversion[1]); } $retval = true; } return $retval; } /** * Determine if the browser is Opera or not * @return boolean True if the browser is Opera otherwise false */ protected function checkBrowserOpera() { $retval = false; if( eregi('opera',$this->_agent) ) { $resultant = stristr($this->_agent, 'opera'); if( eregi('/',$resultant) ) { $aresult = explode('/',$resultant); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_OPERA; $retval = true; } else { $aversion = explode(' ',stristr($resultant,'opera')); $this->setVersion($aversion[1]); $this->_browser_name = self::BROWSER_OPERA; $retval = true; } } return $retval; } /** * Determine if the browser is WebTv or not * @return boolean True if the browser is WebTv otherwise false */ protected function checkBrowserWebTv() { $retval = false; if( eregi('webtv',$this->_agent) ) { $aresult = explode("/",stristr($this->_agent,"webtv")); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_WEBTV; $retval = true; } return $retval; } /** * Determine if the browser is NetPositive or not * @return boolean True if the browser is NetPositive otherwise false */ protected function checkBrowserNetPositive() { $retval = false; if( eregi('NetPositive',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'NetPositive')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->_browser_name = self::BROWSER_NETPOSITIVE; $this->_platform = self::PLATFORM_BEOS; $retval = true; } return $retval; } /** * Determine if the browser is Galeon or not * @return boolean True if the browser is Galeon otherwise false */ protected function checkBrowserGaleon() { $retval = false; if( eregi('galeon',$this->_agent) ) { $aresult = explode(' ',stristr($this->_agent,'galeon')); $aversion = explode('/',$aresult[0]); $this->setVersion($aversion[1]); $this->setBrowser(self::BROWSER_GALEON); $retval = true; } return $retval; } /** * Determine if the browser is Konqueror or not * @return boolean True if the browser is Konqueror otherwise false */ protected function checkBrowserKonqueror() { $retval = false; if( eregi('Konqueror',$this->_agent) ) { $aresult = explode(' ',stristr($this->_agent,'Konqueror')); $aversion = explode('/',$aresult[0]); $this->setVersion($aversion[1]); $this->setBrowser(self::BROWSER_KONQUEROR); $retval = true; } return $retval; } /** * Determine if the browser is iCab or not * @return boolean True if the browser is iCab otherwise false */ protected function checkBrowserIcab() { $retval = false; if( eregi('icab',$this->_agent) ) { $aversion = explode(' ',stristr(str_replace('/',' ',$this->_agent),'icab')); $this->setVersion($aversion[1]); $this->setBrowser(self::BROWSER_ICAB); $retval = true; } return $retval; } /** * Determine if the browser is OmniWeb or not * @return boolean True if the browser is OmniWeb otherwise false */ protected function checkBrowserOmniWeb() { $retval = false; if( eregi('omniweb',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'omniweb')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_OMNIWEB); $retval = true; } return $retval; } /** * Determine if the browser is Phoenix or not * @return boolean True if the browser is Phoenix otherwise false */ protected function checkBrowserPhoenix() { $retval = false; if( eregi('Phoenix',$this->_agent) ) { $aversion = explode('/',stristr($this->_agent,'Phoenix')); $this->setVersion($aversion[1]); $this->setBrowser(self::BROWSER_PHOENIX); $retval = true; } return $retval; } /** * Determine if the browser is Firebird or not * @return boolean True if the browser is Firebird otherwise false */ protected function checkBrowserFirebird() { $retval = false; if( eregi('Firebird',$this->_agent) ) { $aversion = explode('/',stristr($this->_agent,'Firebird')); $this->setVersion($aversion[1]); $this->setBrowser(self::BROWSER_FIREBIRD); $retval = true; } return $retval; } /** * Determine if the browser is Firefox or not * @return boolean True if the browser is Firefox otherwise false */ protected function checkBrowserFirefox() { $retval = false; if( eregi('Firefox',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Firefox')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_FIREFOX); $retval = true; } return $retval; } /** * Determine if the browser is Mozilla or not * @return boolean True if the browser is Mozilla otherwise false */ protected function checkBrowserMozilla() { $retval = false; if( eregi('Mozilla',$this->_agent) && eregi('rv:[0-9].[0-9][a-b]',$this->_agent) && !eregi('netscape',$this->_agent)) { $aversion = explode(' ',stristr($this->_agent,'rv:')); eregi('rv:[0-9].[0-9][a-b]',$this->_agent,$aversion); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_MOZILLA); $retval = true; } else if( eregi('mozilla',$this->_agent) && eregi('rv:[0-9]\.[0-9]',$this->_agent) && !eregi('netscape',$this->_agent) ) { $aversion = explode(" ",stristr($this->_agent,'rv:')); eregi('rv:[0-9]\.[0-9]\.[0-9]',$this->_agent,$aversion); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_MOZILLA); $retval = true; } return $retval; } /** * Determine if the browser is Lynx or not * @return boolean True if the browser is Lynx otherwise false */ protected function checkBrowserLynx() { $retval = false; if( eregi('libwww',$this->_agent) && eregi("lynx", $this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Lynx')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_LYNX); $retval = true; } return $retval; } /** * Determine if the browser is Amaya or not * @return boolean True if the browser is Amaya otherwise false */ protected function checkBrowserAmaya() { $retval = false; if( eregi('libwww',$this->_agent) && eregi("amaya", $this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Amaya')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_AMAYA); $retval = true; } return $retval; } /** * Determine if the browser is Chrome or not * @return boolean True if the browser is Safari otherwise false */ protected function checkBrowserChrome() { $retval = false; if( eregi('Chrome',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Chrome')); $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); $this->setBrowser(self::BROWSER_CHROME); $retval = true; } return $retval; } /** * Determine if the browser is Safari or not * @return boolean True if the browser is Safari otherwise false */ protected function checkBrowserSafari() { $retval = false; if( eregi('Safari',$this->_agent) && ! eregi('iPhone',$this->_agent) && ! eregi('iPod',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(self::VERSION_UNKNOWN); } $this->setBrowser(self::BROWSER_SAFARI); $retval = true; } return $retval; } /** * Determine if the browser is iPhone or not * @return boolean True if the browser is iPhone otherwise false */ protected function checkBrowseriPhone() { $retval = false; if( eregi('iPhone',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(self::VERSION_UNKNOWN); } $this->setBrowser(self::BROWSER_IPHONE); $retval = true; } return $retval; } /** * Determine if the browser is iPod or not * @return boolean True if the browser is iPod otherwise false */ protected function checkBrowseriPod() { $retval = false; if( eregi('iPod',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(self::VERSION_UNKNOWN); } $this->setBrowser(self::BROWSER_IPOD); $retval = true; } return $retval; } /** * Determine if the browser is Android or not * @return boolean True if the browser is Android otherwise false */ protected function checkBrowserAndroid() { $retval = false; if( eregi('Android',$this->_agent) ) { $aresult = explode('/',stristr($this->_agent,'Version')); if( isset($aresult[1]) ) { $aversion = explode(' ',$aresult[1]); $this->setVersion($aversion[0]); } else { $this->setVersion(self::VERSION_UNKNOWN); } $this->setBrowser(self::BROWSER_ANDROID); $retval = true; } return $retval; } /** * Determine the user's platform */ protected function checkPlatform() { if( eregi("iPhone", $this->_agent) ) { $this->_platform = self::PLATFORM_IPHONE; } else if( eregi("iPod", $this->_agent) ) { $this->_platform = self::PLATFORM_IPOD; } else if( eregi("win", $this->_agent) ) { $this->_platform = self::PLATFORM_WINDOWS; } elseif( eregi("mac", $this->_agent) ) { $this->_platform = self::PLATFORM_APPLE; } elseif( eregi("linux", $this->_agent) ) { $this->_platform = self::PLATFORM_LINUX; } elseif( eregi("OS/2", $this->_agent) ) { $this->_platform = self::PLATFORM_OS2; } elseif( eregi("BeOS", $this->_agent) ) { $this->_platform = self::PLATFORM_BEOS; } } } $browser = new Browser(); echo " with "; echo $browser->getBrowser() . " "; echo $browser->getVersion(); ?> Will output You are using [uSER OS] with [uSER BROWSER] If you want to do anything based on browser OS do the following if ( $CurrOS == "Windows Vista" AND $browser->getBrowser() == "Firefox" ) { //Do Something } else { // The aren't using Vista AND Firefox, so condition is false, so do nothing }
  11. In theory (and if you have an excellent knowledge of each application) it's just a case of using the same username & password (ie. same database) across all the applications. In effect this means modifying all pages of all the programs to use the one central database. There are pre-written "bridges" between some programs such as SMF & Joomla, but I think you'd be hard pressed to find one that covers ALL your software packages. Do you know any php?
  12. Hi guys, I've been wondering.... Is it possible to take the $code variable (used to store the text between the [code*] tags) and explode it by \n (newline) characters for example First Line Second Line Third Line <?php $codelines = explode("\n", $code); // or \r\n if it uses this instead echo "First line = $codelines[0]<br>"; echo "Second line = $codelines[1]<br>"; echo "Third line = $codelines[2]<br>"; ?> If so, where would I put it to be useful on the showthread page??
  13. There is no real advantage & certainly a possible dissadvantage to swapping your title tags on a regular basis. Build relevant content with good (related) title tags, then build more pages for variations on that keyphrase. Google will 'see' your change in about a day / week depending on how often your site gets spidered (which depends on how much traffic (and IBLs) your site has. Google however, won't reflect that change in the SERPs for a month, so you'll only get a benefit (if there's one to be had - depending on your chosen new TITLE tags) for every 4th change. In short, if you're tags are well optimised, leave well alone & look to build IBLs and more relevant content. I highly recommend this SEO forum as a great resource for SEO.
  14. \r\n that was my problem .... def. all sorted now!!! Damn I love this forum!!!
  15. Just noticed a problem. It's adding an underscore onto the end of the parse_url variables eg. http://1.com http://2.com Gives 1.com_ 2.com_
  16. Sorry guys, Both solutions did work, it was just me being an idiot. Cags' second solution is working perfectly. Thank you very much all.
  17. Hi guys, badbad's code didn't work, cags' did but I need both the original URLs (broken by newline) and the domain only as two seperate variables. I then need to put them into the DB. I can use two of cags' codes to get the relevant parts but I can't deploy them in a single loop... Eg. Text from textarea http://site1.com/mylink.html\nhttp://site2.com/newlink Required output http://site1.com/mylink.html & site1.com --> INSERT INTO DB http://site2.com/newlink & site2.com --> INSERT INTO DB
  18. That code seems fine, try disabling all other firefox addons & re-running it .... somethings making it execute 3 times & since the primary difference between the 2 browsers is addons my money would be on that as the cause.
  19. Try SQL Union http://www.tizag.com/sqlTutorial/sqlunion.php
  20. Hi guys, I've used this method before but only on a plain $_POST string rather than an array. Here's my code, why is it returning nothing? What this does is take the multi-line values from a textarea, split them at the newline character \n then place them in an array. eg. http://site1.com http://site2.com And what I need to get ( which is why the str_replace & explode is in there) is --> site1.com site2.com // Takes value from the textarea & splits into individual array elements at the newline character $textareaname = $_POST['links']; $str=explode("\n", $textareaname); // While we're looping through the textarea lines, do the following for($i = 0; $i < count($str); $i++){ $url = $str[$i]; // Attempt at getting 'site1.com' from something like 'http://site1.com/folder/fgsjosdj2/index.html' echo $url . "<br><br>"; //Extracts the domain from a URL echo get_domain( $url ) . '<br />'; function get_domain( $url ) { if( strpos( $url, '://' ) !== false ) { list( $throwAway, $url ) = explode( '://', $url ); } if( strpos( $url, '/' ) !== false ) { $url = explode( '/', $url ); $url = array_shift( $url ); } if( preg_match( '/^www[^.]*\..*/', $url ) ) { $url = explode( '.', $url ); array_shift( $url ); $url = implode( '.', $url ); }
  21. I am SUCH an idiot .... stupid obvious thing! Thanks, all working now!
  22. Hi guys, Here's my script. The script is working as it should apart from the fact it's hanging on the first result. When I refresh the page (to re-run the script) it runs perfectly fine. Why?? Could this code be optimised? Pretty sure it could!! <?php // CONNECT TO DB // Select everything from DB $result = mysql_query("SELECT * FROM table") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { //Define variables $new = $row['linkurl']; $url = $row['linkservice']; $emailstatus = $row['emailstatus']; $email = $row ['email']; $origpage = $row['origpage']; switch ($url){ case "mysite.com": $file = file_get_contents($new); $split = explode('Error',$file); if (count($split) > 1 AND $emailstatus==N) { $headers = "From: ASite.com\r\n" . "X-Mailer: php"; $subject = "Email Subject"; $body = "Email body text"; mail($email, $subject, $body, $headers); $result = mysql_query("UPDATE table SET emailstatus ='S', linkstatus ='D' WHERE linkurl='$new' AND email='$email'") or die(mysql_error()); } elseif (count($split) > 1 AND $emailstatus == Y) { // Email already sent, update link status to be dead $result = mysql_query("UPDATE table SET linkstatus ='D' WHERE linkurl='$new' AND userid='$userid'") or die(mysql_error()); } else { // Link is live ... no action necessary } break; } } ?>
  23. Why is this stopping decoding at 32 characters?? :facewall: Encryption part // Encrypt Function function mc_encrypt($encrypt, $mc_key) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $passcrypt = trim(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mc_key, trim($encrypt), MCRYPT_MODE_ECB, $iv)); $encode = base64_encode($passcrypt); return $encode; } // Secret key to encrypt/decrypt with $key = 'something'; // String to encrypt $message = "http://mysite.com/123456789564738752057521097530219750123750921375307953213125"; // EnCrypt string $encrypted = mc_encrypt($message, $key); Decryption Part $encrypted2 = $_GET["passedvariable"]; // Secret key to encrypt/decrypt with $key = 'something'; // 8-32 characters without spaces // Decrypt Function function mc_decrypt($decrypt, $mc_key) { $decoded = base64_decode($decrypt); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $mc_key, trim($decoded), MCRYPT_MODE_ECB, $iv)); return $decrypted; } // DeCrypt back $decrypted = mc_decrypt($encrypted2, $key); Am I using the wrong mcrypt algorigthm? If so which one supports up to 150 characters & how do I alter it in the above example?? Many thanks in advance
  24. Sorry, I should have mentioned that I've tried several mcrypt algo's but my urls seem to be too long - they always cut off / stop decrypting at 32 characters. // Encrypt Function function mc_encrypt($encrypt, $mc_key) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $passcrypt = trim(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mc_key, trim($encrypt), MCRYPT_MODE_ECB, $iv)); $encode = base64_encode($passcrypt); return $encode; } // Decrypt Function function mc_decrypt($decrypt, $mc_key) { $decoded = base64_decode($decrypt); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $mc_key, trim($decoded), MCRYPT_MODE_ECB, $iv)); return $decrypted; } $key = 'something'; $message = 'http://mysite.com/4329358521903853209358305219835210352185321095900-making-this-long-to-test-length'; $encrypted = mc_encrypt($message, $key); $decrypted = mc_decrypt($encrypted, $key); echo "Encrypted = " . $encrypted . "<br /><br />"; echo "Original message for reference = . $message .<br /><br />"; echo "Decrypted = " . $decrypted . "<br /><br />";
  25. Hi guys, I need a very simply encryption algorithm, it will be used to encrypt (effectively hide) the actual URLs basically turning http://none.com into something like this f2kj932fj923fff so my URL (and hence what the user gets to see is the following) http://mysite.com/?myvar=f2kj932fj923fff Instead of this --> http://mysite.com?myvar=http://none.com I must be able to decode this string back to it's plain text with a seperate script though....
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.