Forum Replies Created

Viewing 15 replies - 31 through 45 (of 140 total)
  • Forum: Fixing WordPress
    In reply to: link not opening
    Thread Starter joloshop

    (@joloshop)

    sorry i was testing no its supposed to open https://gutscheincloud.info/go/otto-10prozent-rabatt-4/126891 which now shows but is not opening if you reload it opens

    Forum: Fixing WordPress
    In reply to: link not opening
    Thread Starter joloshop

    (@joloshop)

    Hi thank for your help, i did that. still the link shows but did not open.

    This is my code

    <script type="text/javascript">
    window.setTimeout(function() {
        window.location.href = "<?php echo get_clpr_coupon_url( $post ); ?>";
    }, 2000);
    </script>

    Thread Starter joloshop

    (@joloshop)

    any news?

    Forum: Hacks
    In reply to: switch between datebase
    Thread Starter joloshop

    (@joloshop)

    Thank you bcworkz again,

    i just wanted to make sure if i have to add the $ infront of all database informations.

    Thread Starter joloshop

    (@joloshop)

    well maybe i could help with translating into german.
    It would be great if you somehow could let the user change the db for post, taxonomies for the hole side in generell…

    Looking for something Similar did you find a Solution?

    Forum: Hacks
    In reply to: switch between datebase
    Thread Starter joloshop

    (@joloshop)

    if i would change the database than “all” content would be from the other side, but i only need content from some taxonomies.

    Thread Starter joloshop

    (@joloshop)

    thanks, i think it worked ??

    Thread Starter joloshop

    (@joloshop)

    found another way…..

    Thread Starter joloshop

    (@joloshop)

    thanks, found a solution

    Forum: Hacks
    In reply to: switch between datebase
    Thread Starter joloshop

    (@joloshop)

    Hi its me again, I am lost. Do you know of anybody how could help me with this. I just dont get it. What ever i try i dont get the other database ??

    if i use

    global $exdb
    $exdb = new wpdb( $dbuser, $dbpassword, $dbname, $dbhost );

    do i just have to change
    $dbpassword
    into
    $mypassword
    and so on?

    this helped me on my side a lot just use https://s0.wordpress.com/mshots/v1/https://www.www.ads-software.com/?w=680
    and it is now SSL ??

    Thread Starter joloshop

    (@joloshop)

    thanks again, just trying it with a copy of my database hover i am getting always script error for some tables, my database is huge 400mb ??

    Thread Starter joloshop

    (@joloshop)

    thanks again, yep i know backup, backup, backup. I even duplicated my database and web folder.

    should i than add

    RewriteCond %{SERVER_PORT} !^443
    RewriteRule ^(.*)$ https://ihredomain.tld/$1 [r=301,L]

    to my .htaccess?

    Thread Starter joloshop

    (@joloshop)

    thanks Jan, i never used WP-CLI ??

    do you think a script like this could do the trick as well?

    <?php
    // Database credentials
    $strHost = 'host';
    $strUser = 'user';
    $strPassword = 'password';
    $strDatabase = 'database';
    // From and to path
    $strFrom = 'https://';
    $strTo = 'https://';
    // DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
    error_reporting(E_ALL ^ E_NOTICE);
    function array_strpos($arrHaystack, $strNeedle)
    {
    	foreach ($arrHaystack as $v)
    	{
    		if (is_object($v))
    		{
    			$v = get_object_vars($v);
    		}
    		if (is_array($v) && array_strpos($v, $strNeedle) || !is_array($v) && strpos($v, $strNeedle) !== false)
    		{
    			return true;
    		}
    	}
    	return false;
    }
    function array_str_replace($strSearch, $strReplace, $arrData)
    {
    	foreach ($arrData as $k=>$v)
    	{
    		if (is_array($v))
    		{
    			$arrData[$k] = array_str_replace($strSearch, $strReplace, $v);
    		}
    		elseif (is_string($v))
    		{
    			$arrData[$k] = str_replace($strSearch, $strReplace, $v);
    		}
    	}
    	return $arrData;
    }
    try
    {
    	$db = new PDO
    	(
    		'mysql:dbname=' . $strDatabase . ';host=' . $strHost,
    		$strUser,
    		$strPassword,
    		array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'")
    	);
    	$stmt = $db->query('SHOW TABLES');
    	$stmt->setFetchMode(PDO::FETCH_COLUMN, 0);
    	foreach ($stmt as $strName)
    	{
    		$arrTables[] = $strName;
    	}
    	$intUpdates = 0;
    	if (substr($strFrom, -1) == '/' && substr($strTo, -1) != '/')
    	{
    		$strTo .= '/';
    	}
    	else if (substr($strFrom, -1) != '/' && substr($strTo, -1) == '/')
    	{
    		$strFrom .= '/';
    	}
    	echo 'Searching tables' . "\n";
    	foreach ($arrTables as $strTable)
    	{
    		echo 'Processing ' . $strTable . "\n";
    		$stmt = $db->query(sprintf('SELECT * FROM <code>%s</code>', $strTable));
    		$stmt->setFetchMode(PDO::FETCH_ASSOC);
    		foreach ($stmt as $row)
    		{
    			foreach ($row as $k=>$v)
    			{
    				$blnSerialized = false;
    				$tmp = unserialize($v);
    				if ($tmp !== false)
    				{
    					$blnSerialized = true;
    					$v = $tmp;
    				}
    				if ($k != 'id')
    				{
    					$w = false;
    					if (is_object($v))
    					{
    						$v = get_object_vars($v);
    					}
    					if (is_array($v) && array_strpos($v, $strFrom) !== false)
    					{
    						$w = array_str_replace($strFrom, $strTo, $v);
    					}
    					if (!is_array($v) && strpos($v, $strFrom) !== false)
    					{
    						$w = str_replace($strFrom, $strTo, $v);
    					}
    					if ($w)
    					{
    						if ($blnSerialized)
    						{
    							$v = $row[$k];
    							$w = serialize($w);
    						}
    						$stmt = $db->prepare(sprintf('UPDATE <code>%s</code> SET <code>%s</code>=:value WHERE <code>id</code>=:id', $strTable, $k));
    						$stmt->bindValue('value', $w);
    						$stmt->bindValue('id', $row['id']);
    						$stmt->execute();
    						++$intUpdates;
    					}
    				}
    			}
    		}
    	}
    	echo 'Update finished: ' . sprintf('%d rows updated', $intUpdates) . "\n";
    }
    catch(PDOException $e)
    {
    	var_dump($e->getMessage());
    }

Viewing 15 replies - 31 through 45 (of 140 total)