Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.
Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4319
  • *Latest: thygrim

  • *Total Posts: 15776
  • *Total Topics: 2382
  • *Online Today: 3
  • *Most Online: 157
(27.08.09, 03:54:53)
  • *Users: 0
  • *Guests: 1
  • *Total: 1

Author Topic: Error PmxBlog 1.0  (Read 3536 times)

0 Members and 0 Guests are viewing this topic.

Offline Argon2020

  • Newbie
  • *
  • Posts: 4
  • Gender: Female
Error PmxBlog 1.0
« on: 12.07.12, 11:57:05 »
Set PortaMx v1.5 for SMF 2.0.2

I can not install PmxBlog 1.0
Installed in emulation mode SMF 2.0 and 2.0.1
Do not install.

Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM CHARACTER SET utf8' at line 6
file: Z:\home\gerakl.im\www\Packages\temp\pmxblog_install.php
line: 272

Offline Cool

  • Free Tibet
  • PortaMx Supporter
  • *
  • Posts: 743
  • Gender: Male
  • I Hate Chinas Authority
Re: Error PmxBlog 1.0
« Reply #1 on: 12.07.12, 12:52:11 »
PmxBlog don´t work any more with PortaMx ver.1.5
|I Use: SMF 2.0.4 | PortaMx 1.5.1
Q: What do you do when you see a bear in the woods?
A: Play Dead!

H-A-H-L = Happy Admins Have Linux

Offline Argon2020

  • Newbie
  • *
  • Posts: 4
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #2 on: 12.07.12, 13:08:30 »
Why?
work PortaMx 1.45 ?

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5584
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #3 on: 12.07.12, 17:33:30 »
PmxBlog don´t work any more with PortaMx ver.1.5
That's not absolute correct  ;)
If a 1.5 installed you have to add one function the the file Sources/PmxBlog.php ...

Find the line
Code: [Select]
function PmxBlog()
{
global $context, $sourcedir, $txt, $scripturl, $settings, $modSettings, $options, $user_info, $smcFunc;
Add before
Code: [Select]
/**
* get domain and path for cookies
*/
function pmx_getcookparts()
{
global $boardurl, $modSettings;

$url = pmx_parse_url($boardurl);

// local cookie?
if(empty($url['path']) || empty($modSettings['localCookies']))
$url['path'] = '';
$url['path'] .= '/';

// global cookie?
if(!empty($modSettings['globalCookies']) && preg_match('~^\d{1,3}(\.\d{1,3}){3}$~', $url['host']) == 0 && preg_match('~(?:[^\.]+\.)?([^\.]{2,}\..+)\z~i', $url['host'], $parts) == 1)
$url['host'] = '.'. $parts[1];
elseif(empty($modSettings['localCookies']) && empty($modSettings['globalCookies']))
$url['host'] = '';
elseif(!isset($url['host']) || strpos($url['host'], '.') === false)
$url['host'] = '';

return $url;
}

Now PmxBlog works with PortaMx 1.5  ...
Many are stubborn in relation to the path, a few in relation to the target.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5584
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #4 on: 12.07.12, 17:34:59 »
Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM CHARACTER SET utf8' at line 6
file: Z:\home\gerakl.im\www\Packages\temp\pmxblog_install.php
line: 272


Seems like a problem with you Mysql server (Version?)
Many are stubborn in relation to the path, a few in relation to the target.

Offline Argon2020

  • Newbie
  • *
  • Posts: 4
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #5 on: 12.07.12, 23:43:00 »
Seems like a problem with you Mysql server (Version?)

MySQL 5.5, PHP 5.2

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5584
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #6 on: 16.07.12, 14:05:08 »
It's possible that Mysql 5.5 need a other syntax ...
Try to change
TYPE=MyISAM CHARACTER SET utf8

to

ENGINE=MyISAM  CHARACTER SET=utf8

That you can change in the file pmxblog_install.php
Many are stubborn in relation to the path, a few in relation to the target.

Offline Argon2020

  • Newbie
  • *
  • Posts: 4
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #7 on: 16.07.12, 23:48:22 »
OK! Thank you very much!
Blog is working!!!

Offline kak2z

  • Newbie
  • *
  • Posts: 37
  • Gender: Male
  • SMF 2.0.2 + PortaMx 1.51 UTF-8
    • Дом 2
Re: Error PmxBlog 1.0
« Reply #8 on: 09.08.12, 19:32:30 »
It's possible that Mysql 5.5 need a other syntax ...
Try to change
TYPE=MyISAM CHARACTER SET utf8

to

ENGINE=MyISAM  CHARACTER SET=utf8

That you can change in the file pmxblog_install.php

I can not find this line. Help please.


Code: [Select]
<?php
// -------------------------------------------------------------
// -- pmxblog_install.php                                     --
// -------------------------------------------------------------
// -- Version: 1.0 for SMF 2.0                              --
// -- Copyright 2009-2011 by: PortaMx corp.                   --
// -- Support and Updates at: http://portamx.com              --
// -------------------------------------------------------------

global $modSettings$db_name$db_prefix$user_info;

// Load the SSI.php
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
{
   require_once(dirname(__FILE__) . '/SSI.php');

   // on manual installation you have to logged in
   if(!$user_info['is_admin'])
   {
      if($user_info['is_guest'])
      {
         echo '<b>'$txt['admin_login'],':</b><br />';
         ssi_login($boardurl.'/dbinstall.php');
         die();
      }
      else
      {
         loadLanguage('Errors');
         fatal_error($txt['cannot_admin_forum']);
      }
   }
}
// no SSI.php and no SMF?
elseif (!defined('SMF'))
   die('<b>Error:</b> SSI.php not found. Please verify you put this in the same place as SMF\'s index.php.');

// Load the SMF DB Functions
db_extend('packages');
db_extend('extra');

// check if called with SSI
$isSSI false;
if(eval(
"return sprintf('%s', SMF);") == 'SSI')
   $isSSI true;

// =====================
// setup the defaults
// =====================

// prepare data
$Version 'v1.0';
$cpy '<a href="http://portamx.com" target="_blank">PMxBlog '.$Version.'</a> | <a href="http://portamx.com/license" target="_blank">PmxBlog &copy; 2008-2011</a>, <a href="http://portamx.com/" target="_blank">PortaMx corp.</a>';

// pepare the data array
$settings_data = array(
   'settings' => '60,20,20,0,0,10,0,2',
   'wysiwyg_edit' => 'a:1:{i:0;s:1:"1";}',
   'wysiwyg_comment' => 'a:1:{i:0;s:1:"1";}',
   'modgroups' => 'a:0:{}',
   'blog_acs' => ',:,:,',
   'blogadmin' => '1',
   'thumb_show' => '1',
   'thumb_size' => '100,75',
   'htmltags' => 'div|span|pre|p|h1|h2|h3|h4|h5|h6|blockquote|code|address',
   'copyright' => $cpy,
);

//==============================
// Check table update necessary
//==============================

// Table rename defs
$blog_Tables = array(
   'pmxblog_settings' => 'felblog_settings',
   'pmxblog_manager' => 'felblog_manager',
   'pmxblog_ratings' => 'felblog_ratings',
   'pmxblog_categories' => 'felblog_categories',
   'pmxblog_content' => 'felblog_content',
   'pmxblog_comments' => 'felblog_comments',
   'pmxblog_cont_log' => 'felblog_cont_log'
);

// get a table list
$table_list$smcFunc['db_list_tables']($db_name'%felblog%');
$tbl_prefix explode('.'$db_prefix);
if(isset(
$tbl_prefix[1]))
   $tbl_prefix $tbl_prefix[1];
else
   $tbl_prefix $db_prefix;

if(!empty(
$table_list) && in_array($tbl_prefix .'felblog_cmnt_log'$table_list))
{
   // drop the old comment log table
   $smcFunc['db_query']('security_override''
      DROP TABLE {db_prefix}felblog_cmnt_log'
,
      array()
   );
}

// rename tables
if(!empty($table_list))
{
   foreach($blog_Tables as $newname => $tblname)
   {
      if(!empty($table_list) && in_array($tbl_prefix $tblname$table_list))
      {
         if($isSSI)
            echo 'Rename table: '$tblname .' to '$newname .'<br />';

         $smcFunc['db_query']('security_override''
            RENAME TABLE {db_prefix}'
$tblname .' TO {db_prefix}'$newname .'' ,
            array()
         );
      }
      elseif($isSSI)
         echo 'Table '$tblname .' not exist.<br />';
   }
}

// =============================
// continue normal install
// =============================
$isUTF '';
$req $smcFunc['db_query'](''"
      SELECT value
      FROM {db_prefix}settings
      WHERE variable = 'global_character_set' AND value = 'UTF-8'"
,
   array()
);
if(
$smcFunc['db_num_rows']($req) > 0)
{
   $isUTF ' CHARACTER SET utf8';
   $smcFunc['db_free_result']($req);
}

// PmxBlog Table defs
$pmxblog_Tables = array(
   'pmxblog_settings' =>
      'CREATE TABLE {db_prefix}pmxblog_settings (
         ID int(10) unsigned NOT NULL auto_increment,
         name varchar(25) NOT NULL,
         value text NOT NULL,
         PRIMARY KEY  (ID)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_manager' =>
      'CREATE TABLE {db_prefix}pmxblog_manager (
         owner int(11) NOT NULL default 0,
         blogname tinytext NOT NULL,
         blogdesc tinytext NOT NULL,
         showarchive tinyint(4) NOT NULL default 0,
         showcategories tinyint(4) NOT NULL default 0,
         showcalendar tinyint(4) NOT NULL default 0,
         blogcreated int(11) NOT NULL default 0,
         hidebaronedit int(11) NOT NULL default 0,
         blogenabled tinyint(4) NOT NULL default 0,
         bloglocked tinyint(4) NOT NULL default 0,
         tracking tinytext NOT NULL,
         blograting decimal(3,1) NOT NULL default 0.0,
         blogvotes int(11) NOT NULL default 0,
         settings varchar(10) NOT NULL,
         userpicture tinytext NOT NULL,
         PRIMARY KEY (owner)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_ratings' =>
      'CREATE TABLE {db_prefix}pmxblog_ratings (
         owner int(11) NOT NULL default 0,
         contID int(11) NOT NULL default 0,
         rating text NOT NULL,
         voter text NOT NULL,
         UNIQUE KEY contID (contID),
         KEY owner (owner)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_categories' =>
      'CREATE TABLE {db_prefix}pmxblog_categories (
         ID int(11) NOT NULL auto_increment,
         owner int(11) NOT NULL default 0,
         name tinytext NOT NULL,
         corder int(11) NOT NULL default 0,
         depth tinyint(4) NOT NULL default 0,
         PRIMARY KEY  (ID),
         KEY owner (owner),
         KEY corder (corder)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_content' =>
      'CREATE TABLE {db_prefix}pmxblog_content (
         ID int(10) unsigned NOT NULL auto_increment,
         owner int(10) unsigned NOT NULL default 0,
         ip_address varchar(16) NOT NULL,
         categorie int(10) unsigned NOT NULL default 0,
         nbr_comment tinyint(4) NOT NULL default 0,
         allowcomment tinyint(4) NOT NULL default 0,
         allow_view tinyint(4) NOT NULL default 0,
         date_created int(11) NOT NULL default 0,
         date_lastedit int(11) NOT NULL default 0,
         published tinyint(4) NOT NULL default 0,
         notify tinyint(4) NOT NULL default 0,
         views int(10) unsigned NOT NULL default 0,
         subject tinytext NOT NULL,
         body text NOT NULL,
         PRIMARY KEY  (ID),
         KEY owner (owner),
         KEY categorie (categorie),
         KEY date_created (date_created)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_comments' =>
      'CREATE TABLE {db_prefix}pmxblog_comments (
         ID int(10) unsigned NOT NULL auto_increment,
         author int(10) unsigned NOT NULL default 0,
         username varchar(25) NOT NULL,
         ip_address varchar(16) NOT NULL,
         contID int(10) unsigned NOT NULL default 0,
         parent int(10) unsigned NOT NULL default 0,
         treelevel tinyint(3) unsigned NOT NULL default 0,
         treeS2 int(10) unsigned NOT NULL default 0,
         date_created int(11) NOT NULL default 0,
         date_lastedit int(11) NOT NULL default 0,
         subject tinytext NOT NULL,
         body text NOT NULL,
         PRIMARY KEY  (ID),
         KEY owner (author),
         KEY parent (contID),
         KEY sub_parent (parent),
         KEY date_created (date_created)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_cmnt_log' =>
      'CREATE TABLE {db_prefix}pmxblog_cmnt_log (
         userID int(10) unsigned NOT NULL default 0,
         contID int(10) unsigned NOT NULL default 0,
         cmtID int(10) unsigned NOT NULL default 0,
         KEY userID (userID),
         KEY contID (contID)
      ) TYPE=MyISAM'
$isUTF,

   'pmxblog_cont_log' =>
      'CREATE TABLE {db_prefix}pmxblog_cont_log (
         owner int(10) unsigned NOT NULL default 0,
         userID int(10) unsigned NOT NULL default 0,
         is_read tinytext NOT NULL,
         KEY userID (userID),
         KEY owner (owner)
      ) TYPE=MyISAM'
$isUTF,
);

// get a table list
$table_list $smcFunc['db_list_tables']($db_name'%pmxblog%');
$created = array();

$tbl_prefix explode('.'$db_prefix);
if(isset(
$tbl_prefix[1]))
   $tbl_prefix $tbl_prefix[1];
else
   $tbl_prefix $db_prefix;

foreach(
$pmxblog_Tables as $tblname => $tbldef)
{
   if(empty($table_list) || !in_array($tbl_prefix $tblname$table_list))
   {
      // create the table
      if($isSSI)
         echo 'Create table: '$tblname .'.<br />';

      $created[] = $tblname;
      $smcFunc['db_query']('security_override',
         $tbldef,
         array()
      );
   }
   elseif($isSSI)
      echo 'Table '$tblname .' allready exist.<br />';
}

// rename and change col typ in the manager table
$req $smcFunc['db_query']('security_override''
   SHOW COLUMNS FROM {db_prefix}pmxblog_manager LIKE {string:like}'
,
   array('like' => '%editor')
);
if(
$smcFunc['db_num_rows']($req) != 0)
{
   $smcFunc['db_free_result']($req);

   $smcFunc['db_query']('security_override''
      ALTER TABLE {db_prefix}pmxblog_manager CHANGE editor settings VARCHAR(10) NOT NULL'
,
      array()
   );
}

// add 'notify' col to the content table
$req $smcFunc['db_query']('security_override''
   SHOW COLUMNS FROM {db_prefix}pmxblog_content LIKE {string:like}'
,
   array('like' => '%notify')
);
if(
$smcFunc['db_num_rows']($req) == 0)
{
   $smcFunc['db_free_result']($req);

   $smcFunc['db_query']('security_override''
      ALTER TABLE {db_prefix}pmxblog_content ADD notify TINYINT NOT NULL DEFAULT 0 AFTER published'
,
      array()
   );

   $smcFunc['db_query']('''
      UPDATE {db_prefix}pmxblog_content
         SET notify = published'
,
      array()
   );
}

// clear and reload settings
$result = array();
$req $smcFunc['db_query']('security_override''
      TRUNCATE TABLE {db_prefix}pmxblog_settings'
,
   array()
);
$smcFunc['db_query']('security_override''
   ALTER TABLE {db_prefix}pmxblog_settings CHANGE value value TEXT NOT NULL'
,
   array()
);

foreach(
$settings_data as $name => $value)
{
   $smcFunc['db_insert']('''
      {db_prefix}pmxblog_settings'
,
      array(
         'name' => 'string',
         'value' => 'string'
      ),
      array(
         $name,
         $value
  
   ),
      array('ID')
   );
}

// enable PmxBlog
$req $smcFunc['db_query']('''
      SELECT variable, value
      FROM {db_prefix}settings
      WHERE variable = {string:varname}'
,
   array(
      'varname' => 'pmxblog_enabled'
   )
);
if(
$smcFunc['db_num_rows']($req) > 0)
   $smcFunc['db_free_result']($req);
else
   $smcFunc['db_insert']('replace''
      {db_prefix}settings'
,
      array(
         'variable' => 'string',
         'value' => 'string'
      ),
      array(
         'pmxblog_enabled',
         '1'
      ),
      array('variable')
   );

if(
$isSSI)
   echo 'Done. <br />';
?>
Женский форум про Дом 2, рецепты, каникулы в Мексике и многое другое!

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5584
  • Gender: Female
Re: Error PmxBlog 1.0
« Reply #9 on: 13.08.12, 12:24:00 »
Replace all the TYPE=MyISAM with ENGINE=MyISAM
Many are stubborn in relation to the path, a few in relation to the target.

Offline Lineman

  • Charter Member
  • *
  • Posts: 24
  • Gender: Male
    • God's Chat Room
Re: Error PmxBlog 1.0
« Reply #10 on: 27.08.12, 05:46:11 »
PmxBlog don´t work any more with PortaMx ver.1.5
That's not absolute correct  ;)
If a 1.5 installed you have to add one function the the file Sources/PmxBlog.php ...

Find the line
Code: [Select]
function PmxBlog()
{
global $context, $sourcedir, $txt, $scripturl, $settings, $modSettings, $options, $user_info, $smcFunc;
Add before
Code: [Select]
/**
* get domain and path for cookies
*/
function pmx_getcookparts()
{
global $boardurl, $modSettings;

$url = pmx_parse_url($boardurl);

// local cookie?
if(empty($url['path']) || empty($modSettings['localCookies']))
$url['path'] = '';
$url['path'] .= '/';

// global cookie?
if(!empty($modSettings['globalCookies']) && preg_match('~^\d{1,3}(\.\d{1,3}){3}$~', $url['host']) == 0 && preg_match('~(?:[^\.]+\.)?([^\.]{2,}\..+)\z~i', $url['host'], $parts) == 1)
$url['host'] = '.'. $parts[1];
elseif(empty($modSettings['localCookies']) && empty($modSettings['globalCookies']))
$url['host'] = '';
elseif(!isset($url['host']) || strpos($url['host'], '.') === false)
$url['host'] = '';

return $url;
}

Now PmxBlog works with PortaMx 1.5  ...

Thank you once again Feline... love the blogging system!
What lies behind us, and what lies before us are tiny matters compared to what lies within us.
~Ralph Waldo Emerson