بسم الله الرحمن الرحيم
السلام عليكم و رحمة الله و بركاته
أريد مساعدتكم في برمجة إضافة ووردبرس
المشكلة في التعامل مع الفورم في الإضافة
الإضافة في الملحق
بسم الله الرحمن الرحيم
السلام عليكم و رحمة الله و بركاته
أريد مساعدتكم في برمجة إضافة ووردبرس
المشكلة في التعامل مع الفورم في الإضافة
الإضافة في الملحق
كود الإضافة
<?php
/*
Plugin Name: xxx
Plugin URI: xxx
Description: xxx
Version: 1.0
Author: xxx
Author xxx
License: xxx
*/
if (is_admin())
add_action('admin_menu', 'xxxMetaBox_tw');
function xxxMetaBox_tw()
{
add_meta_box(
'xxxmetaboxtw',
'تويتر',
'xxxBox_tw',
'post',
'normal',
'high'
);
}
function xxxBox_tw($post)
{
function table_exists ($table, $db=DB_NAME) {
$tables = mysql_list_tables ($db);
while (list ($temp) = mysql_fetch_array ($tables)) {
if ($temp == $table) {
return TRUE;
}
}
return FALSE;
}
if (!table_exists("wp_xxxdbtw"))
{
$create = mysql_query("
CREATE TABLE `wp_xxxdbtw` (
`id` INT SIGNED NOT NULL ,
`tweetdb` VARCHAR(200) NULL
)
");
if ($create)
{
echo '<div class="wrap"><h2>'.__("تم إنشاء الجدول بنجاح","xxxdbtw").'</h2></div><br />'.__("يُرجى الإنتظار ...","xxxdbtw");
echo '<META HTTP-EQUIV="refresh" CONTENT="1; URL=post-new.php">';
}else{
echo '<div class="wrap"><h2>'.__("خطأ","xxxdbtw").'</h2></div>';
echo mysql_error();
}
}else{
$tweetdb2 = $_POST['eshtw'];
echo '<p><textarea rows="5" cols="27" name="eshtw"></textarea></p>';
}
$id = get_the_ID();
global $wpdb;
$insert = $wpdb->query('INSERT INTO `wp_xxxdbtw` (id, tweetdb) VALUES('.$id.', "'.$tweetdb2.'");');
}
if (!class_exists("xxx")){
class xxx {
function __construct(){
add_filter('the_content', array($this, 'xxxtweet'));
}
function xxxtweet($content){
$id2 = get_the_ID();
global $wpdb;
$tweets = $wpdb->get_results("SELECT * FROM `wp_xxxdbtw` WHERE id = ".$id2 ,ARRAY_A);
$wpt_pluginpath = WP_PLUGIN_URL;
foreach($tweets as $tweets2){
$tweet1 = $tweets2['tweetdb'];
}
$tweet = str_replace(' ', '+', $tweet1);
$share1 = '<a href="https://twitter.com/intent/tweet?text=';
$share2 = '"><img src= '.$wpt_pluginpath.'/tweetbn_ar.png></a>';
$sharebn = $share1.$tweet.$share2;
$content .= $sharebn;
return $content;
}
}
}
if (class_exists("xxx")){
$signature_obj = new xxx();
}
?>ياحبذا يكون في شرح مختصر عن الاضافة
شكرا على ردك
الإضافة لإرسال تويت للتويتر عندما يضغط المستخدم على تويت
و النص يكتبه المدون عندما يكتب التدوينة
M.B.O كتب:ياحبذا يكون في شرح مختصر عن الاضافة
المشكلة هي = عندما يدخل المدون النص الإضافة لا تأخد النص و تحفظه المشكلة في الفورم
تم تعديل هذه المشاركة بواسطة Max_Reve في 16 فبراير 2012 في 23:14
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…