示例#1
0
 function seo_edited_item($item)
 {
     $itemID = $item['pk_i_id'];
     $item_meta_title = Params::getParam('seo_item_meta_title');
     $item_meta_title_format = json_encode(Params::getParam('seo_item_meta_title_format'));
     $item_meta_description = Params::getParam('seo_item_meta_description');
     $item_meta_keywords = Params::getParam('seo_item_meta_keywords');
     $conn = DBConnectionClass::newInstance();
     $c_db = $conn->getOsclassDb();
     $comm = new DBCommandClass($c_db);
     $values = array('fk_i_item_id' => $itemID, 'seo_item_meta_title' => $item_meta_title, 'seo_item_meta_title_format' => $item_meta_title_format, 'seo_item_meta_description' => $item_meta_description, 'seo_item_meta_keywords' => $item_meta_keywords);
     $run = $comm->replace(SEO_PLUGIN_ITEM_META_TABLE, $values);
     if ($run == false) {
         $comm->insert(SEO_PLUGIN_ITEM_META_TABLE, $values);
     }
 }
 function youtube_item_edit_post($item)
 {
     $catID = $item['fk_i_category_id'];
     $itemID = $item['pk_i_id'];
     $youtube_video = addslashes(Params::getParam('s_youtube'));
     $youtube_id = youtube_get_code_from_url($youtube_video);
     $youtube_video = convert_youtube_url($youtube_video);
     $conn = DBConnectionClass::newInstance();
     $c_db = $conn->getOsclassDb();
     $comm = new DBCommandClass($c_db);
     $values = array('fk_i_item_id' => $itemID, 's_youtube' => $youtube_video, 's_id' => $youtube_id);
     $comm->replace(YOUTUBE_TABLE, $values);
 }