Installation Instructions:
1. Back up your cart database
2. Copy all files in root folder. (app, design, js)
3. app/addons/seo/func.php Add the following code after this code fn_seo_validate_object($seo, $path, $objects){
/* 4sprung web development - start */
if(Registry::get('addons.blog.status') == "A" && $seo['type'] == 't') { // for blog categories
if (Registry::get('runtime.company_id')) {
$company_id = Registry::get('runtime.company_id');
$condition = " WHERE company_id = $company_id";
}
$blog_path = db_get_field("SELECT path_blog FROM ?:blog_settings $condition ");
if($path) {
$current_url_path = rtrim($path, '/');
if($blog_path == $current_url_path) {
return true;
}
}
}
/* 4sprung web development - end */
4. app/addons/seo/func.php Replace "$option_value = Registry::get('addons.seo.' . $seo_var['option']);" by following code in function fn_check_seo_schema_option($seo_var, $option){
/*4sprung modify start*/
if($seo_var['dispatch'] == "blog.view" || $seo_var['dispatch'] == "blog_categories.view") {
$option_value = "file";
} else {
$option_value = Registry::get('addons.seo.' . $seo_var['option']);
}
/*4sprung modify end*/
5. app/addons/seo/func.php Add the following code after this code elseif (!empty($path)) {
/*4sprung Modify start*/
if($vars['dispatch'] == "blog.view" || $vars['dispatch'] == "blog_categories.view") {
$result = true;
} else {
$result = false;
}
/*4sprung Modify end*/
6. app/addons/seo/func.php Add the following code before this code "if (!empty($seo_var['pager'])) {"
/* 4sprung Blog path settings - Start */
if ($parsed_query['dispatch'] == 'blog.view' && !empty($parsed_query['blog_news_id'])) {
if (Registry::get('runtime.company_id')) {
$company_id = Registry::get('runtime.company_id');
$condition = "WHERE company_id = $company_id";
}
$blog_path = db_get_field("SELECT path_blog FROM ?:blog_settings $condition ");
if($blog_path != "") {
$parent_item_names[] .= $blog_path;
$link_parts['parent_items_names'] = !empty($parent_item_names) ? join('/', $parent_item_names) . "/" : "";
}
$link_parts['name'] = fn_seo_get_name('b', $parsed_query['blog_news_id'], '','', $lang_code);
$link_parts['extension'] = SEO_FILENAME_EXTENSION;
fn_seo_parced_query_unset($parsed_query, 'blog_news_id');
} elseif ($parsed_query['dispatch'] == 'blog_categories.view' && !empty($parsed_query['bcategory_id'])) {
if (Registry::get('runtime.company_id')) {
$company_id = Registry::get('runtime.company_id');
$condition = "WHERE company_id = $company_id";
}
$blog_path = db_get_field("SELECT path_blog FROM ?:blog_settings $condition ");
if($blog_path != "") {
$parent_item_names[] .= $blog_path;
$link_parts['parent_items_names'] = !empty($parent_item_names) ? join('/', $parent_item_names) . "/" : "";
}
$link_parts['name'] = fn_seo_get_name('t', $parsed_query['bcategory_id'], '','', $lang_code);
$link_parts['extension'] = SEO_FILENAME_EXTENSION;
fn_seo_parced_query_unset($parsed_query, 'bcategory_id');
}
/* Blog path settings - end */
6.1 changes on Addons On Google Sitemap:
Open the 'app/addons/google_sitemap/func.php' and add the following code:
Line no: 53 add the below code
//Blog sitemap xml code start
case 'cblog':
if(Registry::get('addons.blog.status')=="A"){
$link = htmlentities('blog_categories.view?bcategory_id=' . $value);
}
break;
case 'blog':
if(Registry::get('addons.blog.status')=="A"){
$link = htmlentities('blog.view?blog_news_id=' . $value);
}
break;
//Blog sitemap xml code end
Add this code on fn_google_sitemap_generate_link function in switch case.
6.2 Add the following function after if ($sitemap_settings['include_products'] == "Y") {
//Blog Category sitemap xml code start
if(Registry::get('addons.blog.status')=="A"){
$cblogs = db_get_fields("SELECT bcategory_id FROM ?:blog_category_descriptions");
//Add the all active categories
if(!empty($cblogs))
{
foreach ($cblogs as $cblog) {
$links = fn_google_sitemap_generate_link('cblog', $cblog, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, 'daily', $cblog_array_xml_sitemap['priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links_blg, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
//Blog Category sitemap xml code end
//Blog sitemap xml code start
$blogs = db_get_fields("SELECT blog_news_id FROM ?:blog_descriptions");
//Add the all active categories
if(!empty($blogs))
{
foreach ($blogs as $blog) {
$links = fn_google_sitemap_generate_link('blog', $blog, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, 'daily', $blog_array_xml_sitemap['priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links_blg, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
}
//Blog sitemap xml code end
6.3: app/addons/seo/func.php Find fn_set_hook('validate_sef_object', $path, $seo, $vars, $result, $objects); replace with //fn_set_hook('validate_sef_object', $path, $seo, $vars, $result, $objects);
6.4 : app/addons/seo/func.php Comment all deprecated function in seo/func.php except for function fn_seo_parced_query_unset
********************************************************
To Generate RSS
RSS Generate URL: YOUR_SITE_URL/index.php?dispatch=blog_rss.view
RSS URL: YOUR_SITE_URL/rss_feed.xml