update
This commit is contained in:
@@ -8,14 +8,14 @@ class System
|
|||||||
$date = file_get_contents( 'files/.update' );
|
$date = file_get_contents( 'files/.update' );
|
||||||
else
|
else
|
||||||
$date = '2012-01-01 00:00:00';
|
$date = '2012-01-01 00:00:00';
|
||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLayout( $id )
|
public function getLayout( $id )
|
||||||
{
|
{
|
||||||
global $db, $config, $cache;
|
global $db, $config, $cache;
|
||||||
|
|
||||||
$key = 'getLayout:' . $id;
|
$key = 'getLayout:' . $id;
|
||||||
if ( !$layout = $cache -> fetch() )
|
if ( !$layout = $cache -> fetch() )
|
||||||
{
|
{
|
||||||
@@ -28,16 +28,16 @@ class System
|
|||||||
}
|
}
|
||||||
return $layout;
|
return $layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLayouts()
|
public function getLayouts()
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$query = $db -> query( 'SELECT id, name FROM pcms_layout' );
|
$query = $db -> query( 'SELECT id, name FROM pcms_layout' );
|
||||||
if ( $query -> rowCount() ) while ( $row = $query -> fetch() )
|
if ( $query -> rowCount() ) while ( $row = $query -> fetch() )
|
||||||
$layouts[] = $row;
|
$layouts[] = $row;
|
||||||
$query -> closeCursor();
|
$query -> closeCursor();
|
||||||
|
|
||||||
return $layouts;
|
return $layouts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,12 +183,12 @@ class System
|
|||||||
|
|
||||||
public function getSessionVar( $var , $admin = false )
|
public function getSessionVar( $var , $admin = false )
|
||||||
{
|
{
|
||||||
if ( !$admin )
|
if ( !$admin )
|
||||||
{
|
{
|
||||||
if ( isset( $_SESSION[ $var ] ) )
|
if ( isset( $_SESSION[ $var ] ) )
|
||||||
$out = $_SESSION[ $var ];
|
$out = $_SESSION[ $var ];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( isset( $_SESSION[ 'admin_' . $var ] ) )
|
if ( isset( $_SESSION[ 'admin_' . $var ] ) )
|
||||||
$out = $_SESSION[ 'admin_' . $var ];
|
$out = $_SESSION[ 'admin_' . $var ];
|
||||||
@@ -446,12 +446,12 @@ class System
|
|||||||
if ( !$row2['seo_link'] )
|
if ( !$row2['seo_link'] )
|
||||||
$site_map .= '<loc>' . $link_base . 's,' . $row2['page_id'] . ',' . self::seo( $row2['title'] ) . '</loc>' . $nl;
|
$site_map .= '<loc>' . $link_base . 's,' . $row2['page_id'] . ',' . self::seo( $row2['title'] ) . '</loc>' . $nl;
|
||||||
else
|
else
|
||||||
$site_map .= '<loc>' . $link_base . $row['seo_link'] . '</loc>' . $nl;
|
$site_map .= '<loc>' . $link_base . $row['seo_link'] . '</loc>' . $nl;
|
||||||
$site_map .= '<lastmod>' . date( 'Y-m-d' ) . '</lastmod>' . $nl;
|
$site_map .= '<lastmod>' . date( 'Y-m-d' ) . '</lastmod>' . $nl;
|
||||||
$site_map .= '<changefreq>daily</changefreq>' . $nl;
|
$site_map .= '<changefreq>daily</changefreq>' . $nl;
|
||||||
$site_map .= '<priority>1</priority>' . $nl;
|
$site_map .= '<priority>1</priority>' . $nl;
|
||||||
$site_map .= '</url>' . $nl;
|
$site_map .= '</url>' . $nl;
|
||||||
|
|
||||||
if ( $row2['seo_link'] )
|
if ( $row2['seo_link'] )
|
||||||
$htaccess_data .= chr( 13 ).chr( 10 ) . 'RewriteRule ^' . $row2['seo_link'] . '$ index.php?rw=change_site&id=' . $row2['page_id'] . ' [L]';
|
$htaccess_data .= chr( 13 ).chr( 10 ) . 'RewriteRule ^' . $row2['seo_link'] . '$ index.php?rw=change_site&id=' . $row2['page_id'] . ' [L]';
|
||||||
}
|
}
|
||||||
@@ -470,7 +470,7 @@ class System
|
|||||||
$site_map .= '<changefreq>daily</changefreq>' . $nl;
|
$site_map .= '<changefreq>daily</changefreq>' . $nl;
|
||||||
$site_map .= '<priority>1</priority>' . $nl;
|
$site_map .= '<priority>1</priority>' . $nl;
|
||||||
$site_map .= '</url>' . $nl;
|
$site_map .= '</url>' . $nl;
|
||||||
|
|
||||||
if ( $row2['seo_link'] )
|
if ( $row2['seo_link'] )
|
||||||
$htaccess_data .= chr( 13 ).chr( 10 ) . 'RewriteRule ^' . $row2['seo_link'] . '$ index.php?art=$1' . $row2['article_id'] . ' [L]';
|
$htaccess_data .= chr( 13 ).chr( 10 ) . 'RewriteRule ^' . $row2['seo_link'] . '$ index.php?art=$1' . $row2['article_id'] . ' [L]';
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ class System
|
|||||||
$val = str_replace( $array_rep1 , $array_rep2 , $val );
|
$val = str_replace( $array_rep1 , $array_rep2 , $val );
|
||||||
$val = strtolower( $val );
|
$val = strtolower( $val );
|
||||||
$val = preg_replace( '/(-){2,}/', '-', $val );
|
$val = preg_replace( '/(-){2,}/', '-', $val );
|
||||||
|
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -822,7 +822,7 @@ class System
|
|||||||
if ( isset($email) && isset($temat) && isset($tresc) )
|
if ( isset($email) && isset($temat) && isset($tresc) )
|
||||||
{
|
{
|
||||||
$admin_mail = self::getSystemSettings( 'admin_email');
|
$admin_mail = self::getSystemSettings( 'admin_email');
|
||||||
$mail = new PHPMailer();
|
$mail = new PHPMailer();
|
||||||
$mail -> IsSMTP();
|
$mail -> IsSMTP();
|
||||||
$mail -> SMTPAuth = true;
|
$mail -> SMTPAuth = true;
|
||||||
$mail -> Host = self::getSystemSettings( 'email_host' );
|
$mail -> Host = self::getSystemSettings( 'email_host' );
|
||||||
@@ -832,13 +832,13 @@ class System
|
|||||||
$mail -> CharSet = "UTF-8";
|
$mail -> CharSet = "UTF-8";
|
||||||
if ( $replay == "" )
|
if ( $replay == "" )
|
||||||
{
|
{
|
||||||
$mail -> AddReplyTo( $admin_mail , self::getSystemSettings( 'firm_name' ) );
|
$mail -> AddReplyTo( $admin_mail, $admin_mail );
|
||||||
$mail -> SetFrom( $admin_mail , self::getSystemSettings( 'firm_name' ) );
|
$mail -> SetFrom( $admin_mail, $admin_mail );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mail -> AddReplyTo( $replay , '' );
|
$mail -> AddReplyTo( $replay, '' );
|
||||||
$mail -> SetFrom( $replay , '' );
|
$mail -> SetFrom( $admin_mail, '' );
|
||||||
}
|
}
|
||||||
$mail -> AddAddress( $email , '' );
|
$mail -> AddAddress( $email , '' );
|
||||||
$mail -> Subject = $temat;
|
$mail -> Subject = $temat;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function moveArticlesToArchive( $articles )
|
|||||||
{
|
{
|
||||||
$articles = explode( ':', $articles );
|
$articles = explode( ':', $articles );
|
||||||
if ( is_array( $articles ) ) foreach ( $articles as $art )
|
if ( is_array( $articles ) ) foreach ( $articles as $art )
|
||||||
\admin\factory\ArticleManager::setAsArchive( $art );
|
\admin\factory\ArticleManager::setAsArchive( $art );
|
||||||
|
|
||||||
$objResponse = new xajaxResponse();
|
$objResponse = new xajaxResponse();
|
||||||
$objResponse -> script( 'document.location.href="./";' );
|
$objResponse -> script( 'document.location.href="./";' );
|
||||||
@@ -54,7 +54,7 @@ function closeAdvert()
|
|||||||
function deleteArticleImg( $id )
|
function deleteArticleImg( $id )
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$query = $db -> prepare( 'SELECT * FROM pcms_article_images WHERE id = :id' );
|
$query = $db -> prepare( 'SELECT * FROM pcms_article_images WHERE id = :id' );
|
||||||
$query -> bindValue( ':id' , $id , \PDO::PARAM_INT );
|
$query -> bindValue( ':id' , $id , \PDO::PARAM_INT );
|
||||||
$query -> execute();
|
$query -> execute();
|
||||||
@@ -68,7 +68,7 @@ function deleteArticleImg( $id )
|
|||||||
$query = $db -> prepare( 'DELETE FROM pcms_article_images WHERE id = :id' );
|
$query = $db -> prepare( 'DELETE FROM pcms_article_images WHERE id = :id' );
|
||||||
$query -> bindValue( ':id' , $id , \PDO::PARAM_INT );
|
$query -> bindValue( ':id' , $id , \PDO::PARAM_INT );
|
||||||
$query -> execute();
|
$query -> execute();
|
||||||
$query -> closeCursor();
|
$query -> closeCursor();
|
||||||
|
|
||||||
$objResponse = new xajaxResponse();
|
$objResponse = new xajaxResponse();
|
||||||
$objResponse -> script( '$( "#li_' . $id . '").remove();' );
|
$objResponse -> script( '$( "#li_' . $id . '").remove();' );
|
||||||
@@ -84,7 +84,7 @@ function saveArticlesOrder( $id , $order )
|
|||||||
$order = str_replace( ']', '', $order );
|
$order = str_replace( ']', '', $order );
|
||||||
$order = str_replace( '[', '', $order );
|
$order = str_replace( '[', '', $order );
|
||||||
$order = explode( ',', $order );
|
$order = explode( ',', $order );
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if ( is_array( $order ) ) foreach ( $order as $o )
|
if ( is_array( $order ) ) foreach ( $order as $o )
|
||||||
{
|
{
|
||||||
@@ -127,7 +127,7 @@ function loginUser( $login , $password ) {
|
|||||||
'condition' => 'login = "' . \mySQL::sec( $login ) . '" AND password = "' . md5( $password ) . '" AND enabled = "1"'
|
'condition' => 'login = "' . \mySQL::sec( $login ) . '" AND password = "' . md5( $password ) . '" AND enabled = "1"'
|
||||||
);
|
);
|
||||||
$result = $dbs -> get( $data , false , true );
|
$result = $dbs -> get( $data , false , true );
|
||||||
|
|
||||||
$query = $db -> prepare( 'SELECT * FROM pcms_user WHERE login = :login AND password = :password AND enabled = 1' );
|
$query = $db -> prepare( 'SELECT * FROM pcms_user WHERE login = :login AND password = :password AND enabled = 1' );
|
||||||
$query -> bindValue( ':login', mysql_real_escape_string( $login ), \PDO::PARAM_STR );
|
$query -> bindValue( ':login', mysql_real_escape_string( $login ), \PDO::PARAM_STR );
|
||||||
$query -> bindValue( ':password', md5( $password ), \PDO::PARAM_STR );
|
$query -> bindValue( ':password', md5( $password ), \PDO::PARAM_STR );
|
||||||
@@ -137,15 +137,15 @@ function loginUser( $login , $password ) {
|
|||||||
$user = \user\FUser::login( $login , $password );
|
$user = \user\FUser::login( $login , $password );
|
||||||
\System::setSessionVar( 'user' , $user );
|
\System::setSessionVar( 'user' , $user );
|
||||||
$message = 'document.location.href="' . \System::getMainPage() . '";';
|
$message = 'document.location.href="' . \System::getMainPage() . '";';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message = '$(".jqibox").css("display","none");';
|
$message = '$(".jqibox").css("display","none");';
|
||||||
$message .= "$.prompt('" . $lang -> getTrans( 'T_BRAK_UZYTKOWNIKA_KONTO_NIEAKTYWNE' ) . "',{ buttons: { " . $lang -> getTrans( 'T_ZAMKNIJ' ) . ": true }, focus: 1 });";
|
$message .= "$.prompt('" . $lang -> getTrans( 'T_BRAK_UZYTKOWNIKA_KONTO_NIEAKTYWNE' ) . "',{ buttons: { " . $lang -> getTrans( 'T_ZAMKNIJ' ) . ": true }, focus: 1 });";
|
||||||
$message .= 'setTimeout(function(){$(".jqibox").css("display","none");},3000);';
|
$message .= 'setTimeout(function(){$(".jqibox").css("display","none");},3000);';
|
||||||
}
|
}
|
||||||
$query -> closeCursor();
|
$query -> closeCursor();
|
||||||
|
|
||||||
$objResponse -> script( $message );
|
$objResponse -> script( $message );
|
||||||
|
|
||||||
return $objResponse;
|
return $objResponse;
|
||||||
@@ -380,9 +380,9 @@ function changeLang( $lang_id )
|
|||||||
function saveArticle( $id, $enabled, $comments, $print, $show_title, $show_date, $pages , $show_author , $keep_archive, $layout )
|
function saveArticle( $id, $enabled, $comments, $print, $show_title, $show_date, $pages , $show_author , $keep_archive, $layout )
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
$new = false;
|
$new = false;
|
||||||
|
|
||||||
if ( $id )
|
if ( $id )
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE
|
$sql = 'UPDATE
|
||||||
@@ -433,30 +433,30 @@ function saveArticle( $id, $enabled, $comments, $print, $show_title, $show_date,
|
|||||||
$query -> closeCursor();
|
$query -> closeCursor();
|
||||||
|
|
||||||
$id = $db -> lastInsertId();
|
$id = $db -> lastInsertId();
|
||||||
|
|
||||||
$query = $db -> query( 'SELECT * FROM pcms_article_images WHERE id_article = 0' );
|
$query = $db -> query( 'SELECT * FROM pcms_article_images WHERE id_article = 0' );
|
||||||
if ( $query -> rowCount() ) while ( $row = $query -> fetch() )
|
if ( $query -> rowCount() ) while ( $row = $query -> fetch() )
|
||||||
{
|
{
|
||||||
$dir = 'upload/galeries/article_' . $id . '/';
|
$dir = 'upload/galeries/article_' . $id . '/';
|
||||||
if ( !is_dir( "../ " . $dir ) )
|
if ( !is_dir( "../ " . $dir ) )
|
||||||
mkdir( "../" . $dir , 0755 , true );
|
mkdir( "../" . $dir , 0755 , true );
|
||||||
|
|
||||||
$file = explode( '/', $row['src'] );
|
$file = explode( '/', $row['src'] );
|
||||||
$file = $file[3];
|
$file = $file[3];
|
||||||
|
|
||||||
if ( file_exists( '../' . $row['src'] ) )
|
if ( file_exists( '../' . $row['src'] ) )
|
||||||
{
|
{
|
||||||
rename( '../' . $row['src'], '../' . $dir . $file );
|
rename( '../' . $row['src'], '../' . $dir . $file );
|
||||||
$query2 = $db -> prepare( 'UPDATE pcms_article_images SET id_article = :id_article, src = :src WHERE id = :id' );
|
$query2 = $db -> prepare( 'UPDATE pcms_article_images SET id_article = :id_article, src = :src WHERE id = :id' );
|
||||||
$query2 -> bindValue( ':id_article', $id, \PDO::PARAM_INT );
|
$query2 -> bindValue( ':id_article', $id, \PDO::PARAM_INT );
|
||||||
$query2 -> bindValue( ':src', $dir . $file, \PDO::PARAM_STR );
|
$query2 -> bindValue( ':src', $dir . $file, \PDO::PARAM_STR );
|
||||||
$query2 -> bindValue( ':id', $row['id'], \PDO::PARAM_INT );
|
$query2 -> bindValue( ':id', $row['id'], \PDO::PARAM_INT );
|
||||||
$query2 -> execute();
|
$query2 -> execute();
|
||||||
$query2 -> closeCursor();
|
$query2 -> closeCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$query -> closeCursor();
|
$query -> closeCursor();
|
||||||
|
|
||||||
$new = true;
|
$new = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,7 +511,7 @@ function saveArticle( $id, $enabled, $comments, $print, $show_title, $show_date,
|
|||||||
function saveArticleTranslation( $lang_id , $id , $title , $meta_description , $meta_keywords , $text , $message , $keep_archive, $version, $seo_link, $new )
|
function saveArticleTranslation( $lang_id , $id , $title , $meta_description , $meta_keywords , $text , $message , $keep_archive, $version, $seo_link, $new )
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if ( is_null( $version ) )
|
if ( is_null( $version ) )
|
||||||
$version = 1;
|
$version = 1;
|
||||||
|
|
||||||
@@ -561,7 +561,7 @@ function saveArticleTranslation( $lang_id , $id , $title , $meta_description , $
|
|||||||
$query2 -> execute();
|
$query2 -> execute();
|
||||||
$query2 -> closeCursor();
|
$query2 -> closeCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $message )
|
if ( $message )
|
||||||
{
|
{
|
||||||
$objResponse = new xajaxResponse();
|
$objResponse = new xajaxResponse();
|
||||||
|
|||||||
Reference in New Issue
Block a user