Freedata
function tweegi_admin_styles() { wp_enqueue_style( 'tweegiStylesheet' ); wp_enqueue_style( 'tweegiStylesheet1' ); wp_enqueue_style( 'tweegiStylesheet2' ); } function tweegi_make_upload_dir () { if(!is_dir(TWEEGI_UPLOAD_PATH)) { if (!is_dir(WP_UPLOAD_PATH)) { $dir1 = mkdir(WP_UPLOAD_PATH,0777,true); @chmod (WP_UPLOAD_PATH,0777); } else { @chmod (WP_UPLOAD_PATH,0777); } $dir = mkdir(TWEEGI_UPLOAD_PATH,0777,true); if(!$dir) { } else { @chmod (TWEEGI_UPLOAD_PATH,0777); } } else { @chmod (TWEEGI_UPLOAD_PATH,0777); } } function tweegi_admin() { $parent = 'tweet-and-get-it/tweetandgetit_admin.php'; $parent_list = 'tweet-and-get-it/tweetandgetit_admin_list.php'; add_object_page('TweetAndGetIt', esc_attr(__('Tweet&Get it!', TWEEGI_TRASNLATE)), 0, $parent, '', TWEEGI_URLPATH.'/img/favicon.png'); add_submenu_page($parent, "Tweet & Get it Make your button", __("Make your button",TWEEGI_TRASNLATE), 0, $parent); add_submenu_page($parent, "Manage Tweet And Get It buttons", __("Manage your buttons",TWEEGI_TRASNLATE), 0, $parent_list); add_action( 'admin_print_styles-' . $parent, 'tweegi_admin_styles' ); add_action( 'admin_print_styles-' . $parent_list, 'tweegi_admin_styles' ); } function tweegi_admin_init() { wp_register_style( 'tweegiStylesheet', WP_PLUGIN_URL . '/tweet-and-get-it/css/skins/red.css' ); wp_register_style( 'tweegiStylesheet1', WP_PLUGIN_URL . '/tweet-and-get-it/css/style.css' ); wp_register_style( 'tweegiStylesheet2', WP_PLUGIN_URL . '/tweet-and-get-it/admin/css/style.css' ); } function tweegi_plugin_init () { add_action('admin_menu', 'tweegi_admin'); add_action( 'admin_init', 'tweegi_admin_init' ); wp_deregister_script( 'tweegi_script' ); wp_register_script( 'tweegi_script', TWEEGI_URLPATH."/js/tweegi_redirect.js"); wp_enqueue_script( 'tweegi_script' ); } function tweegi_callback($ma) { return "javascript:tweegiopenNewWindow('".$ma[1]."'"; } function tweegi_content_hook($content) { if ((strpos($content,"javascript:tweegiopenNewWindow"))) { $hostPattern = "/javascript:tweegiopenNewWindow\(['\"]([^'\"]+)['\"]/"; $cc = preg_replace_callback($hostPattern,'tweegi_callback',$content); return $cc; } return $content; } function tweegi_shortcode_handler( $atts ) { global $tbl_tweetandgetit_buttons,$wpdb; extract( shortcode_atts( array( 'name' => 'something', ), $atts ) ); $sql = "select * from $tbl_tweetandgetit_buttons where button_name=\"".trim($name)."\""; $row = $wpdb->get_results($wpdb->prepare($sql)); if($wpdb->num_rows == 0) { return ''; } if(strpos($row[0]->file_path,"TWEEGE_FILE:") == 1) { $row[0]->file_path = str_replace(":TWEEGE_FILE:",'',$row[0]->file_path); } $lang = get_bloginfo( "language", "raw" ); $data=array("tweet"=>$row[0]->tweet, "file"=>$row[0]->file_path, "blogger"=>$row[0]->twitter_name, "domain"=>$_SERVER['HTTP_HOST'], "btnname"=>$row[0]->button_name,"language"=>$lang); $encoded=urlencode(base64_encode(utf8_encode(serialize($data)))); $tweet = urlencode(base64_encode($row[0]->tweet)); $file = urlencode(base64_encode($row[0]->file_path)); $blogger= urlencode(base64_encode($row[0]->twitter_name)); $domain= urlencode(base64_encode($_SERVER['HTTP_HOST'])); $btnname= urlencode(base64_encode($row[0]->button_name)); $language= urlencode(base64_encode($lang)); $url = "http://tweetandgetit.com/process.php?tweet=$tweet&file=$file&blogger=$blogger&domain=$domain&btnname=$btnname&language=$lang"; $url = "http://tweetandgetit.com/process.php?data=$encoded"; $content.= '
Tweet&getit is powered by Viuu
".__("Failed to $mode button, change button name and try again",TWEEGI_TRASNLATE)."!"; } else if (!$out) { echo "
".__("Failed to $mode button, change some button attributes and try again",TWEEGI_TRASNLATE)."!"; } else { echo "
'; } die(); } ?>".__("Your button is ready",TWEEGI_TRASNLATE)." !
".__("copy / paste this code in your posts, pages and widgets",TWEEGI_TRASNLATE)." !
".$shortcode.'