Hi Everyone,
Well i haven't got time these days so was not able to work on this plugin. Am still working on it as you can see...
This is a small preview for everyone out there...
You can help me focus on this project by sending me some donations if you can...:P
";
xydac_show_donate_link();
echo "
Addin Music to poetry
";
}
function xydac_cms_build_active_field_types()
{
$cpts=array();
$cpts['posttype'] = xydac_get_active_cpt();
$cpts['pagetype'] = get_active_page_types();
$cpts['taxtype'] = xydac_get_active_taxonomy();
$xydac_active_field_types = array();
if(is_array($cpts))
foreach($cpts as $k=>$cpt)
{
foreach($cpt as $cp)
{
if('posttype'==$k)
$fields = getCptFields($cp['name']);
else if('pagetype'==$k)
$fields = get_page_type_fields($cp['name']);
else if('pagetype'==$k)
$fields = get_taxonomy_fields($cp['name']);
if(is_array($fields) && !empty($fields))
foreach($fields as $field)
{
if(!in_array($field['field_type'],$xydac_active_field_types))
array_push($xydac_active_field_types,$field['field_type']);
}
}
}
update_option('xydac_active_field_types',$xydac_active_field_types);
}
function xydac_cms_cpt_field_convert()
{ global $wpdb;
$cpts = get_reg_cptName();
if(is_array($cpts))
foreach($cpts as $cpt)
{
$fields = getCptFields($cpt);
if(is_array($fields) && !empty($fields))
foreach($fields as $field)
{
$metas = $wpdb->get_results("SELECT meta_id, meta_value FROM ".$wpdb->postmeta." WHERE meta_key ='".$field['field_name']."'");
foreach($metas as $meta)
{
$meta->meta_value = maybe_unserialize($meta->meta_value);
$r = false;
if(is_array($meta->meta_value))
{
foreach($meta->meta_value as $k=>$v)
if($k==$field['field_type'])
{
$wpdb->query("UPDATE ".$wpdb->postmeta." SET meta_value='".$v."' WHERE meta_id = ".$meta->meta_id);
}
}
}
if(!in_array($field['field_type'],$xydac_active_field_types))
array_push($xydac_active_field_types,$field['field_type']);
}
}
update_option('xydac_active_field_types',$xydac_active_field_types);
update_option('xydac_cms_ver','1.0');
}
if ( !function_exists( 'xydac_cms_activate' ) ) {function xydac_cms_activate()
{
global $wpdb;
if (function_exists('is_multisite') && is_multisite()) {
// check if it is a network activation - if so, run the activation function for each blog id
if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
$old_blog = $wpdb->blogid;
// Get all blog ids
$blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs"));
foreach ($blogids as $blog_id) {
switch_to_blog($blog_id);
xydac_cms_cpt_field_convert();
do_action('xydac_cms_activate');
}
switch_to_blog($old_blog);
return;
}
}
xydac_cms_cpt_field_convert();
do_action('xydac_cms_activate');
}}
function is_xydac_ucms_pro(){
$k = get_option(XYDAC_CMS_USER_API_KEY);
if(empty($k))
return false;
else
return true;
}
function xydac_show_donate_link($showimage=true){
echo '