แจก amazon auto post Plugin Amazon ที่ผมเขียนเอง V.2 [ By.chuanguru ]

เริ่มโดย chuanguru, 26 มกราคม 2008, 00:44:06

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

BB

[direct=https://sienped.co/MyTiktok]โชว์ยอด Lazada ทุกวัน ช่อง "เซียนเป็ด"[/direct]
[direct=https://www.youtube.com/duckcommerce]สอนหาเงินจาก Youtube & Affiliate[/direct]
[direct=https://100ksecrets.co/]สอนทำ Affiliate[/direct]
[direct=https://startblogeasy.co/]คอร์สฟรี สอนสร้างเว็บไซต์ ติดตั้ง Wordpress หาเงินจาก Adsense[/direct]
[direct=https://sienped.blog/]สอนหาเงินออนไลน์[/direct]

Newbies

อ้างถึงจาก: kanokk ใน 04 กุมภาพันธ์ 2008, 13:17:45
ถามเซียน PHP หน่อยอ่ะคับ ก่อนนอน ตีหนึ่งแล้ว :P :P :P :P
มีเรื่องที่จะให้ช่วยในทาง SEO ขึ้นเยอะเลย ถ้าแก้ได้นะคับ


โคดตรงนี้ในไฟลล์ amazon_auto_post.php
$insert_table=mysql_query("INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title,post_status,post_type,comment_status, ping_status,post_name,post_modified,post_modified_gmt, post_parent,menu_order) values('1','$daytopost','$daytopost','$content_to_post_replace_string','$title_to_post2', 'future', 'post', 'open','open','admin','$daytopost','$daytopost','0','0')") or die (mysql_error());

ตรง open','admin','$daytopost', อ่ะคับ ค่าตัวแปร มันใช้เป็น admin แล้วยัดค่า admin เข้าตาราง post_name เฉยๆเลย ซึ่งตรงฟิลล์นี้ ถ้าไม่แก้ มันก็จะใช้ชื่อใน URL เป็น ประมาณ www.กกกกกก.com/XX/XX/admin ไปเรื่อยๆ ซึ่งตามปกติ WP จะดึงค่าจากฟิลล์นี้มาเป็น URL แบบที่เป็นชื่อเลยอ่ะคับ ชื่อแบบที่มีขีดกั้น

คราวนี้ในไฟลล์มันจะใช้ตัวแปร $title_to_post2 นี้ เป็นชื่อโพสต์ ชื่อหัวข้อ แต่ถ้าใส่ $title_to_post2 เข้าไปในตารางตรงๆเลย มันจะไม่ได้ เพราะยังไม่ได้แปลงค่า เช่น พวกเว้นวรรค ขีด วงเล็บ ให้เป้นแบบ URL ได้อ่ะคับ (ประมาณว่ามันไม่ยอม rewrite ให้)

คราวนี้เลยอยากทราบว่าพอจะมีวิธีแก้มั้ยอ่ะคับ เพื่อที่จะได้ URL แบบ SEF มากขึ้น แบบมีชื่อโพสต์หรือชื่อสินค้าใน URL ได้อ่ะคับ

ขอบคุณล่วงหน้าคับ
ปล.แก้ไม่เป้นอ่ะคับ แค่พอ งมๆ ได้ ว่ามาน error ตรงไหน แบบว่า เป้นแค่ โปเกมอนอ่ะ ไม่ใช่โปรแกรมเมอร์


ตามที่งมได้นะครับ มีคอมเม้นดังนี้
อย่างที่บอกใน v1 เรื่อง connect database เราไม่ต้อง connect ก็ได้ เพราะ wp มัน connect ให้อยู่แล้ว แต่เราต้องใส่ตัวแปรนี้ ในฟังก์ชั่นของเรา global $wpdb; เช่น
function mt_toplevel_page() {
global $wpdb;

...

จากนั้นเราจะ query, fetch_row,... ยังงัยก็ได้
ไฟล์ connect.php ไม่ต้องใช้ครับ

mysql_close ไม่มีก็ได้ครับ ปล่อยมันไปเลย มัน close เองเมื่อเสร็จงานอยู่แ้ล้ว
ส่วน mysql_die นี่ก็แล้วแต่ครับ เอาไว้ตรวจสอบก็ได้ ว่ามัน die ตรงไหน

$wpdb->query("..."); เท่ากับ mysql_query("..."); ใช้อันไหนก็ได้
$wpdb->get_var("..."); ใช้ get ค่าใดค่าหนึ่งค่าเดียว ออกจากแถว
นอกนั้นก็มี $wpdb->get_col(), $wpdb->get_row(),... ให้ใช้ครับ แล้วแต่กรณี
sanitize_title() เป็นฟังก์ชั่นของ wp ใช้แปลงคำ
Rock 'Em Sock 'Em Robots เป็น rock-em-sock-em-robots
ใช้แปลง title เป็น post_name เพื่อใส่ใน database

แก้ให้เท่าที่จำเป็นนะครับ จะใส่ //+++++++++ ไว้ว่าเติมหรือแก้ตรงไหน
function mt_toplevel_page() {
global $wpdb; //+++++++++++++++++++++++++++++++++
    echo "<h2>Amazon Auto Post </h2>";
// variables for the field and option names
  $opt_name = 'mt_amazon_associate';
   $hidden_field_name = 'mt_submit_hidden';
    $data_field_name = 'amazon_associate';
$keyword='amazonkeyword';


    // Read in existing option value from database
    $opt_val = get_option( $opt_name );

    // See if the user has posted us some information
    // If they did, this hidden field will be set to 'Y'
    if( $_POST[ $hidden_field_name ] == 'Y' ) {
        // Read their posted value
        $opt_val = $_POST[ $data_field_name ];


 

        // Save the posted value in the database
        update_option( $opt_name, $opt_val );

        // Put an options updated message on the screen

?>

<div class="updated"><p><strong><?php _e('Post Amazon Product ^_^.''mt_trans_domain' ); ?></strong></p>


<?php 

include('functions/amazon_functions.php');

for (
$x 1$x <=$_POST$keyword ]; $x++) {

//random keyword
$RANDOM_TXT_FILE=$_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/amazon_auto_post/random.txt'

srand((double)microtime()*1000000);

if (
file_exists($RANDOM_TXT_FILE)) {
$arry_txt preg_split("/--NEXT--/"join(''file($RANDOM_TXT_FILE)));

// echo $arry_txt[rand(0, sizeof($arry_txt) -1)];
} else {
// echo "Error: can't open $RANDOM_IMG_FILE file";
}

$random_keyword=strtolower($arry_txt[rand(0sizeof($arry_txt) -1)]);

srand(time());
$random = (rand()%50);

//$Data=amazon_search_keyword($_POST[ $keyword ],"toys","HEAVY",$random);
$Data=amazon_search_keyword($random_keyword,"toys","HEAVY",$random);

//echo $random_keyword;
$HTMLProductInformation=amazon_create_productinfo($Data);
if (
$HTMLProductInformation=="<i>no such product found</i>")
{

//echo "<font color=red>Not found product From Your Random Keyword List. No post</font><br>";
if ($x<1){$x=1;}
$x=$x-1;

}
else 
{

$ThisItem=$Data[Details][0];

//echo $HTMLProductInformation;
$title_to_post=$ThisItem[ProductName][0];

$content_to_post=$HTMLProductInformation;
//$content_to_post2="<font color=#FFFFFF>".$HTMLProductInformation."</font>";

$content_to_post_replace_string=str_replace("'""''"$content_to_post);
$title_to_post2=str_replace("'""''"$title_to_post);

//$content_to_post_replace_string=mysql_real_escape_string($content_to_post);
//$title_to_post2=mysql_real_escape_string($title_to_post);

//$today = date("Y-m-d h:i:s");
//print "<CENTER>Today SERVER is: $today</CENTER>"; 

//$datechange=date(d)+1;

$datechange=date('Y-m-d'mktime(0,0,0date('m'),date('d')+$x,date('Y')));
//$datechange=date('Y-m-d', mktime(0,0,0, date('m'),date('d'),date('Y')));
if ($x<1){$x=1;}

$hourchange=(rand()%23);
//$hourchange=date(h);


$minutechange=(rand()%59);
//$minutechange=date(i)+$x;

$secondchange=(rand()%59);

$daytopost=$datechange." ".$hourchange.":".$minutechange.":".$secondchange;
//print "<CENTER>Today is: $daytopost</CENTER>"; 

//2008-01-20 02:15:40.
$daytopost date("Y-m-d h:i:s");
echo 
"<font color=red>Post Article :</font>".$title_to_post2." <font color=blue>to date </font>".$daytopost."<br>";

//include('functions/connect.php');//+++++++++++++++++++++++++++++++++

//$sql = "select * from wp_posts where post_title = '$title_to_post2' ";
//$db_query = mysql_query ($sql);//+++++++++++++++++++++++++++++++++
//$num_rows = mysql_num_rows($db_query); // check all record
// or
//$num_rows=$wpdb->get_var("select count(*) from wp_posts where post_title = '$title_to_post2'"); //+++++++++++++++++++++++++++++++++ or
$num_rows=$wpdb->get_var("select ID from wp_posts where post_title = '$title_to_post2'"); //+++++++++++++++++++++++++++++++++ 
if($num_rows 0)
{
echo "<font color=red>Duplicate Content Eliminate is </font>".$title_to_post2."<br>";
 } 
else
{
$post_name sanitize_title($title_to_post2);//+++++++++++++++++++++++++++++++++
$gmtdate=get_gmt_from_date($daytopost);
$insert_table=$wpdb->query("INSERT INTO wp_posts (post_author, post_date,post_date_gmt, post_content, post_title,post_status,post_type,comment_status, ping_status,post_name, post_parent,menu_order) values('1','$daytopost','$gmtdate','$content_to_post_replace_string','$title_to_post2', 'future', 'post', 'open','open','$post_name','0','0')");//+++++++++++++++++++++++++++++++++

$postid=mysql_insert_id();
wp_set_post_categories($postid,0);

$guid get_permalink($postid);//+++++++++++++++++++++++++++++++++
$wpdb->query("UPDATE wp_posts SET guid = '$guid' WHERE ID = '$postid'");//+++++++++++++++++++++++++++++++++



//add_action('publish_future_post', $postid);
//wp_schedule_single_event(strtotime($daytopost), 'publish_future_post', array($postid));
//wp_schedule_single_event($daytopost,'publish_future_post', array($postid));

wp_clear_scheduled_hook'publish_future_post'$postid );
wp_schedule_single_event(strtotime($daytopost), 'publish_future_post', array($postid));
//query_posts($insert_table);


//wp_schedule_single_event(strtotime($daytopost), 'publish_future_post');
//do_action('publish_future_post', $postid);
//add_action('publish_future_post', 'wp_publish_post', 10, 1);
//wp_remove_event('publish_future_post', $postid);
//add_action("save_post","changeFuturePost");


//add_meta($postid);


//$update_table=mysql_query("UPDATE wp_posts SET post_status = 'future' WHERE wp_posts.ID=$postid LIMIT 1") or die (mysql_error());

if(!$insert_table)
{
//mysql_die();//+++++++++++++++++++++++++++++++++
}
else
{

}
//mysql_close();//+++++++++++++++++++++++++++++++++
// else check duplicate
// end else


  
// end for
  
echo"<br><h1><font color=red>Insert Data Complete !! ^_^ </font></h1>";
?>


</div>
<?php
  
    
}

    
// Now display the options editing screen

    
echo '<div class="wrap">';

    
// header

    
echo "<h2>" __'Amazon Auto Post Plugin Options''mt_trans_domain' ) . "</h2>";

    
// options form
    
    
?>


<form name="form1" method="post" action="<?php echo str_replace'%7E''~'$_SERVER['REQUEST_URI']); ?>">
<input type="hidden" name="<?php echo $hidden_field_name?>" value="Y">

<p><?php _e("How many article Do you want to post :"'amazonkeyword' ); ?>
<input type="text" name="<?php echo $keyword?>" value=""size="20">
</p><hr />

<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Post Amazon Product''mt_trans_domain' ?>" />
</p>

</form>
</div>

<?php
 
}

?>




kanokk

#62
ขอบคุณคาบ เด๊่ยวเอาไปลองก่อนนะคับ
โปเกมอน มารับงานต่อจาก โปรแกรมเมอร์

(กอปไปวางเฉยๆ ทำไรมะค่อยเป้นอ่ะ  :P :P)
ลองใช้แล้วคาบ ตอนนี้ URL เป้นแบบชื่อ title แล้วคาบ ขอบคุณมากคาบ

ปล. ตอนนี้ลองกับ localhost appserv มันไม่ตั้ง post แบบ รายวันแล้วอ่ะคับ
มานเป้นแบบนี้แทน คือ โพสต์ต่อไปหลังจาก 3 วินาที

Post Article :Conan to date 2008-02-04 04:24:21
Post Article :Silent Hill to date 2008-02-04 04:24:32
Duplicate Content Eliminate is Silent Hill
Post Article :Gears Of War to date 2008-02-04 04:24:40
Post Article :WWE SmackDown! Here Comes the Pain to date 2008-02-04 04:24:48
Duplicate Content Eliminate is WWE SmackDown! Here Comes the Pain
Post Article :NBA 08 to date 2008-02-04 04:24:55
Post Article :Fire Pro Wrestling Returns to date 2008-02-04 04:25:03
Post Article :Final Fantasy X-2 to date 2008-02-04 04:25:14
Post Article :Cabela''s Dangerous Hunts to date 2008-02-04 04:25:21
Post Article :Tom Clancy''s Ghost Recon to date 2008-02-04 04:25:29
Post Article :Playseats Evolution Gaming Seat (White with Silver) to date 2008-02-04 04:25:33
Post Article :Romance of the Three Kingdoms VI: Awakening of the Dragon to date 2008-02-04 04:25:41
Post Article :Karaoke Revolution Presents: American Idol Encore BUNDLE to date 2008-02-04 04:25:49
Post Article :Mortal Kombat Deception to date 2008-02-04 04:25:54
Post Article :Xbox 360 Wireless Gaming Receiver for Windows to date 2008-02-04 04:26:01
Post Article :PlayStation Portable 2GB Memory Stick to date 2008-02-04 04:26:08
Duplicate Content Eliminate is PlayStation Portable 2GB Memory Stick


แต่ไม่ป็นไรคับ ได้แค่นี้ก็ชื่นชมมากๆแล้วคาบ
:-* :-* :-*

ปล. เลยลบ $daytopost = date("Y-m-d h:i:s"); line 134 ออก แล้วก็กลับเป้นแกติ โพสต์รายวันละคับ
[direct=http://www.photonvps.com/billing/aff.php?aff=540]PhotonVPS.com : VPS แรงๆ SSD Cluod ราคา $5.95[/direct]
[direct=http://myvirpus.com/aff.php?aff=243]Virpus.com VPS ดีๆ ราคาถูก XEN VPS ลด 10% โค้ด 20OFF012014 และ SSD Cloud VPS [/direct]
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=kanokk5]HostGator ใช้คูปอง bigsavergator เหลือ 0.01$[/direct]

john490

สคลิปนี้มันใช้ยังไงผมก็เพิ่งเริ่มทำแล้วต้องใช้โปรแกรมอะไรบ้าง

ช่วยตอบที่นะ :-*


:'(


bankch

มีปัญหาครับ คือเมื่อถึงเวลามันไม่ยอม post

ดูใน Scheduled Entries ตอนแรกมันขึ้นว่า

Melissa & Doug Underwater 48-Piece Floor Puzzle in 2 mins

พอผ่านไป 2 นาทีแทนที่มันจะ post เวลามันกลับเพิ่มขึ้นครับ กลายเป็น 6 mins

แล้วก็เพิ่มขึ้นเรื่อยๆ ไม่ทราบว่าต้องทำไง งง มากๆครับ

??? ???




cthawees

อ้างถึงจาก: Newbies ใน 04 กุมภาพันธ์ 2008, 15:22:56
อ้างถึงจาก: kanokk ใน 04 กุมภาพันธ์ 2008, 13:17:45
ถามเซียน PHP หน่อยอ่ะคับ ก่อนนอน ตีหนึ่งแล้ว :P :P :P :P
มีเรื่องที่จะให้ช่วยในทาง SEO ขึ้นเยอะเลย ถ้าแก้ได้นะคับ


โคดตรงนี้ในไฟลล์ amazon_auto_post.php
$insert_table=mysql_query("INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title,post_status,post_type,comment_status, ping_status,post_name,post_modified,post_modified_gmt, post_parent,menu_order) values('1','$daytopost','$daytopost','$content_to_post_replace_string','$title_to_post2', 'future', 'post', 'open','open','admin','$daytopost','$daytopost','0','0')") or die (mysql_error());

ตรง open','admin','$daytopost', อ่ะคับ ค่าตัวแปร มันใช้เป็น admin แล้วยัดค่า admin เข้าตาราง post_name เฉยๆเลย ซึ่งตรงฟิลล์นี้ ถ้าไม่แก้ มันก็จะใช้ชื่อใน URL เป็น ประมาณ www.กกกกกก.com/XX/XX/admin ไปเรื่อยๆ ซึ่งตามปกติ WP จะดึงค่าจากฟิลล์นี้มาเป็น URL แบบที่เป็นชื่อเลยอ่ะคับ ชื่อแบบที่มีขีดกั้น

คราวนี้ในไฟลล์มันจะใช้ตัวแปร $title_to_post2 นี้ เป็นชื่อโพสต์ ชื่อหัวข้อ แต่ถ้าใส่ $title_to_post2 เข้าไปในตารางตรงๆเลย มันจะไม่ได้ เพราะยังไม่ได้แปลงค่า เช่น พวกเว้นวรรค ขีด วงเล็บ ให้เป้นแบบ URL ได้อ่ะคับ (ประมาณว่ามันไม่ยอม rewrite ให้)

คราวนี้เลยอยากทราบว่าพอจะมีวิธีแก้มั้ยอ่ะคับ เพื่อที่จะได้ URL แบบ SEF มากขึ้น แบบมีชื่อโพสต์หรือชื่อสินค้าใน URL ได้อ่ะคับ

ขอบคุณล่วงหน้าคับ
ปล.แก้ไม่เป้นอ่ะคับ แค่พอ งมๆ ได้ ว่ามาน error ตรงไหน แบบว่า เป้นแค่ โปเกมอนอ่ะ ไม่ใช่โปรแกรมเมอร์


ตามที่งมได้นะครับ มีคอมเม้นดังนี้
อย่างที่บอกใน v1 เรื่อง connect database เราไม่ต้อง connect ก็ได้ เพราะ wp มัน connect ให้อยู่แล้ว แต่เราต้องใส่ตัวแปรนี้ ในฟังก์ชั่นของเรา global $wpdb; เช่น
function mt_toplevel_page() {
global $wpdb;

...

จากนั้นเราจะ query, fetch_row,... ยังงัยก็ได้
ไฟล์ connect.php ไม่ต้องใช้ครับ

mysql_close ไม่มีก็ได้ครับ ปล่อยมันไปเลย มัน close เองเมื่อเสร็จงานอยู่แ้ล้ว
ส่วน mysql_die นี่ก็แล้วแต่ครับ เอาไว้ตรวจสอบก็ได้ ว่ามัน die ตรงไหน

$wpdb->query("..."); เท่ากับ mysql_query("..."); ใช้อันไหนก็ได้
$wpdb->get_var("..."); ใช้ get ค่าใดค่าหนึ่งค่าเดียว ออกจากแถว
นอกนั้นก็มี $wpdb->get_col(), $wpdb->get_row(),... ให้ใช้ครับ แล้วแต่กรณี
sanitize_title() เป็นฟังก์ชั่นของ wp ใช้แปลงคำ
Rock 'Em Sock 'Em Robots เป็น rock-em-sock-em-robots
ใช้แปลง title เป็น post_name เพื่อใส่ใน database

แก้ให้เท่าที่จำเป็นนะครับ จะใส่ //+++++++++ ไว้ว่าเติมหรือแก้ตรงไหน
function mt_toplevel_page() {
global $wpdb; //+++++++++++++++++++++++++++++++++
    echo "<h2>Amazon Auto Post </h2>";
// variables for the field and option names
  $opt_name = 'mt_amazon_associate';
   $hidden_field_name = 'mt_submit_hidden';
    $data_field_name = 'amazon_associate';
$keyword='amazonkeyword';


    // Read in existing option value from database
    $opt_val = get_option( $opt_name );

    // See if the user has posted us some information
    // If they did, this hidden field will be set to 'Y'
    if( $_POST[ $hidden_field_name ] == 'Y' ) {
        // Read their posted value
        $opt_val = $_POST[ $data_field_name ];


 

        // Save the posted value in the database
        update_option( $opt_name, $opt_val );

        // Put an options updated message on the screen

?>

<div class="updated"><p><strong><?php _e('Post Amazon Product ^_^.''mt_trans_domain' ); ?></strong></p>


<?php 

include('functions/amazon_functions.php');

for (
$x 1$x <=$_POST$keyword ]; $x++) {

//random keyword
$RANDOM_TXT_FILE=$_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/amazon_auto_post/random.txt'

srand((double)microtime()*1000000);

if (
file_exists($RANDOM_TXT_FILE)) {
$arry_txt preg_split("/--NEXT--/"join(''file($RANDOM_TXT_FILE)));

// echo $arry_txt[rand(0, sizeof($arry_txt) -1)];
} else {
// echo "Error: can't open $RANDOM_IMG_FILE file";
}

$random_keyword=strtolower($arry_txt[rand(0sizeof($arry_txt) -1)]);

srand(time());
$random = (rand()%50);

//$Data=amazon_search_keyword($_POST[ $keyword ],"toys","HEAVY",$random);
$Data=amazon_search_keyword($random_keyword,"toys","HEAVY",$random);

//echo $random_keyword;
$HTMLProductInformation=amazon_create_productinfo($Data);
if (
$HTMLProductInformation=="<i>no such product found</i>")
{

//echo "<font color=red>Not found product From Your Random Keyword List. No post</font><br>";
if ($x<1){$x=1;}
$x=$x-1;

}
else 
{

$ThisItem=$Data[Details][0];

//echo $HTMLProductInformation;
$title_to_post=$ThisItem[ProductName][0];

$content_to_post=$HTMLProductInformation;
//$content_to_post2="<font color=#FFFFFF>".$HTMLProductInformation."</font>";

$content_to_post_replace_string=str_replace("'""''"$content_to_post);
$title_to_post2=str_replace("'""''"$title_to_post);

//$content_to_post_replace_string=mysql_real_escape_string($content_to_post);
//$title_to_post2=mysql_real_escape_string($title_to_post);

//$today = date("Y-m-d h:i:s");
//print "<CENTER>Today SERVER is: $today</CENTER>"; 

//$datechange=date(d)+1;

$datechange=date('Y-m-d'mktime(0,0,0date('m'),date('d')+$x,date('Y')));
//$datechange=date('Y-m-d', mktime(0,0,0, date('m'),date('d'),date('Y')));
if ($x<1){$x=1;}

$hourchange=(rand()%23);
//$hourchange=date(h);


$minutechange=(rand()%59);
//$minutechange=date(i)+$x;

$secondchange=(rand()%59);

$daytopost=$datechange." ".$hourchange.":".$minutechange.":".$secondchange;
//print "<CENTER>Today is: $daytopost</CENTER>"; 

//2008-01-20 02:15:40.
$daytopost date("Y-m-d h:i:s");
echo 
"<font color=red>Post Article :</font>".$title_to_post2." <font color=blue>to date </font>".$daytopost."<br>";

//include('functions/connect.php');//+++++++++++++++++++++++++++++++++

//$sql = "select * from wp_posts where post_title = '$title_to_post2' ";
//$db_query = mysql_query ($sql);//+++++++++++++++++++++++++++++++++
//$num_rows = mysql_num_rows($db_query); // check all record
// or
//$num_rows=$wpdb->get_var("select count(*) from wp_posts where post_title = '$title_to_post2'"); //+++++++++++++++++++++++++++++++++ or
$num_rows=$wpdb->get_var("select ID from wp_posts where post_title = '$title_to_post2'"); //+++++++++++++++++++++++++++++++++ 
if($num_rows 0)
{
echo "<font color=red>Duplicate Content Eliminate is </font>".$title_to_post2."<br>";
 } 
else
{
$post_name sanitize_title($title_to_post2);//+++++++++++++++++++++++++++++++++
$gmtdate=get_gmt_from_date($daytopost);
$insert_table=$wpdb->query("INSERT INTO wp_posts (post_author, post_date,post_date_gmt, post_content, post_title,post_status,post_type,comment_status, ping_status,post_name, post_parent,menu_order) values('1','$daytopost','$gmtdate','$content_to_post_replace_string','$title_to_post2', 'future', 'post', 'open','open','$post_name','0','0')");//+++++++++++++++++++++++++++++++++

$postid=mysql_insert_id();
wp_set_post_categories($postid,0);

$guid get_permalink($postid);//+++++++++++++++++++++++++++++++++
$wpdb->query("UPDATE wp_posts SET guid = '$guid' WHERE ID = '$postid'");//+++++++++++++++++++++++++++++++++



//add_action('publish_future_post', $postid);
//wp_schedule_single_event(strtotime($daytopost), 'publish_future_post', array($postid));
//wp_schedule_single_event($daytopost,'publish_future_post', array($postid));

wp_clear_scheduled_hook'publish_future_post'$postid );
wp_schedule_single_event(strtotime($daytopost), 'publish_future_post', array($postid));
//query_posts($insert_table);


//wp_schedule_single_event(strtotime($daytopost), 'publish_future_post');
//do_action('publish_future_post', $postid);
//add_action('publish_future_post', 'wp_publish_post', 10, 1);
//wp_remove_event('publish_future_post', $postid);
//add_action("save_post","changeFuturePost");


//add_meta($postid);


//$update_table=mysql_query("UPDATE wp_posts SET post_status = 'future' WHERE wp_posts.ID=$postid LIMIT 1") or die (mysql_error());

if(!$insert_table)
{
//mysql_die();//+++++++++++++++++++++++++++++++++
}
else
{

}
//mysql_close();//+++++++++++++++++++++++++++++++++
// else check duplicate
// end else


  
// end for
  
echo"<br><h1><font color=red>Insert Data Complete !! ^_^ </font></h1>";
?>


</div>
<?php
  
    
}

    
// Now display the options editing screen

    
echo '<div class="wrap">';

    
// header

    
echo "<h2>" __'Amazon Auto Post Plugin Options''mt_trans_domain' ) . "</h2>";

    
// options form
    
    
?>


<form name="form1" method="post" action="<?php echo str_replace'%7E''~'$_SERVER['REQUEST_URI']); ?>">
<input type="hidden" name="<?php echo $hidden_field_name?>" value="Y">

<p><?php _e("How many article Do you want to post :"'amazonkeyword' ); ?>
<input type="text" name="<?php echo $keyword?>" value=""size="20">
</p><hr />

<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Post Amazon Product''mt_trans_domain' ?>" />
</p>

</form>
</div>

<?php
 
}

?>


.

ลองใช้สคิปนี้แล้วมันไม่ยอมลง table ให้อ่ะครับ ยังไงรบกวนช่วยลองแก้ปัญหาให้ทีงับ ความรู้เกี่ยวกับโปรแกรมแค่หางอึ่ง  :P

inloveshop

มันโพสไม่ได้ค่ะ ขึ้น warning แบบเนี่ยะ  :-X

Post Amazon Product ^_^.

Warning: fsockopen() has been disabled for security reasons in /www/icspace.net/w/o/m/women-clothing/htdocs/wp-content/plugins/amazon_auto_post/functions/amazon_functions.php on line 1048

kanokk

[direct=http://www.photonvps.com/billing/aff.php?aff=540]PhotonVPS.com : VPS แรงๆ SSD Cluod ราคา $5.95[/direct]
[direct=http://myvirpus.com/aff.php?aff=243]Virpus.com VPS ดีๆ ราคาถูก XEN VPS ลด 10% โค้ด 20OFF012014 และ SSD Cloud VPS [/direct]
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=kanokk5]HostGator ใช้คูปอง bigsavergator เหลือ 0.01$[/direct]

inloveshop


inloveshop

อ้างถึงจาก: jetlee ใน 29 มกราคม 2008, 15:05:25
//$Data=amazon_search_keyword($_POST[ $keyword ],"toys","HEAVY",$random);
$Data=amazon_search_keyword($random_keyword,"toys","HEAVY",$random);

โค๊ดตรง toys ต้องเปลี่ยน ไปตามสินค้าของเราด้วยหรือปล่าวครับ

ดูไปดูมา ที่ auto post มันมีแต่ของเล่นทั้งนั้นเลยค่ะ ทั้งๆที่เปลี่ยนที่ไฟล์ random แล้ว แล้วตกลง Code ที่อ้างอิงนี่มันต้องแก้มั้ยคะ  ???

aomkan


kanokk

อ้างถึงจาก: inloveshop ใน 17 กุมภาพันธ์ 2008, 11:57:13
อ้างถึงจาก: jetlee ใน 29 มกราคม 2008, 15:05:25
//$Data=amazon_search_keyword($_POST[ $keyword ],"toys","HEAVY",$random);
$Data=amazon_search_keyword($random_keyword,"toys","HEAVY",$random);

โค๊ดตรง toys ต้องเปลี่ยน ไปตามสินค้าของเราด้วยหรือปล่าวครับ

ดูไปดูมา ที่ auto post มันมีแต่ของเล่นทั้งนั้นเลยค่ะ ทั้งๆที่เปลี่ยนที่ไฟล์ random แล้ว แล้วตกลง Code ที่อ้างอิงนี่มันต้องแก้มั้ยคะ  ???

ต้องแก้ toys ให้เป็นหมวดหมู่ที่เราต้องการด้วย แล้วก็แก้ random.txt อีกที สองต่อนะคับ

ใช้เวอร์ชันไหนอ่ะคับ อันตัวเดิม หรือตัวที่แก้เอา connect.php ออกแล้ว
[direct=http://www.photonvps.com/billing/aff.php?aff=540]PhotonVPS.com : VPS แรงๆ SSD Cluod ราคา $5.95[/direct]
[direct=http://myvirpus.com/aff.php?aff=243]Virpus.com VPS ดีๆ ราคาถูก XEN VPS ลด 10% โค้ด 20OFF012014 และ SSD Cloud VPS [/direct]
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=kanokk5]HostGator ใช้คูปอง bigsavergator เหลือ 0.01$[/direct]

inloveshop

อ้างถึงจาก: kanokk ใน 17 กุมภาพันธ์ 2008, 16:02:04
อ้างถึงจาก: inloveshop ใน 17 กุมภาพันธ์ 2008, 11:57:13
อ้างถึงจาก: jetlee ใน 29 มกราคม 2008, 15:05:25
//$Data=amazon_search_keyword($_POST[ $keyword ],"toys","HEAVY",$random);
$Data=amazon_search_keyword($random_keyword,"toys","HEAVY",$random);

โค๊ดตรง toys ต้องเปลี่ยน ไปตามสินค้าของเราด้วยหรือปล่าวครับ

ดูไปดูมา ที่ auto post มันมีแต่ของเล่นทั้งนั้นเลยค่ะ ทั้งๆที่เปลี่ยนที่ไฟล์ random แล้ว แล้วตกลง Code ที่อ้างอิงนี่มันต้องแก้มั้ยคะ  ???

ต้องแก้ toys ให้เป็นหมวดหมู่ที่เราต้องการด้วย แล้วก็แก้ random.txt อีกที สองต่อนะคับ

ใช้เวอร์ชันไหนอ่ะคับ อันตัวเดิม หรือตัวที่แก้เอา connect.php ออกแล้ว

ใช้ V.2 ค่ะ อืม สรุปคือว่าต้องแก้เป็นชื่อหมวดหมู่ที่เราต้องการใช่มั้ยคะ  :-[ เดี๋ยวจาลองดูอีกทีนะคะ ขอบคุณค่ะ  :-*

zimba

books, music, classical, vhs, dvd, toys, baby, videogames, electronics, software, universal, garden, kitchen, photo, pc-hardware
อย่าพิมพ์เป็นอย่างอื่นนะครับไม่งั้นโปรแกรมจะหาสินค้าไม่เจอให้เอาในหมวดที่ผมให้ไปเท่านั้น


ใส่ได้แค่นี้นะครับ อย่าใส่นอกเหนือจากนี้
เพราะใน script กำหนดค่าตัวแปรไว้ให้แค่นี้ครับ
ถ้าอยากได้หมวดอื่นมากกว่านี้ต้องเขียนโค้ดเพิ่มเองต่างหาก

inloveshop

อ้างถึงจาก: zimba ใน 17 กุมภาพันธ์ 2008, 16:23:39
books, music, classical, vhs, dvd, toys, baby, videogames, electronics, software, universal, garden, kitchen, photo, pc-hardware
อย่าพิมพ์เป็นอย่างอื่นนะครับไม่งั้นโปรแกรมจะหาสินค้าไม่เจอให้เอาในหมวดที่ผมให้ไปเท่านั้น


ใส่ได้แค่นี้นะครับ อย่าใส่นอกเหนือจากนี้
เพราะใน script กำหนดค่าตัวแปรไว้ให้แค่นี้ครับ
ถ้าอยากได้หมวดอื่นมากกว่านี้ต้องเขียนโค้ดเพิ่มเองต่างหาก

ขอบคุณค่ะ ดีนะ ยังไม่ได้ทำ  ;D

Nice

ขอบพระคุณค่ะ โหลดเก็บไว้ก่อน ยังไม่รู้จะได้ใช้ตอนไหน  :)

geddd

update wordpress เป็น 2.3.3 แล้วใช้ไม่ได้อ่ะค่ะ แก้ยังไงได้บ้างอะคะ

รู้สึกจะมีปัญหาที่ บรรทัดนี้อ่ะค่ะ $num_rows = mysql_num_rows($db_query); // check all record

wp_posts ค่ะ

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.tucksy/123456/xxx-xxx.info/wp-content/plugins/amazon_auto_post/amazon_auto_post.php on line 140
Table 'xxxdata.wp_posts' doesn't exist
When the rain stops, the sky clears and a rainbow appears. Our troubles pass and life is beautiful and bright again.

jiraiyax

เวลา Post แล้วมันขึ้นลิงก์แบบนี้น่ะครับ hxxp://...../home-entertainments/admin/
ต้องทำอย่างไรถึงจะให้มันแสดงเป็น hxxp://...../home-entertainments/ชื่อสินค้า ครับ

kanokk

[direct=http://www.photonvps.com/billing/aff.php?aff=540]PhotonVPS.com : VPS แรงๆ SSD Cluod ราคา $5.95[/direct]
[direct=http://myvirpus.com/aff.php?aff=243]Virpus.com VPS ดีๆ ราคาถูก XEN VPS ลด 10% โค้ด 20OFF012014 และ SSD Cloud VPS [/direct]
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=kanokk5]HostGator ใช้คูปอง bigsavergator เหลือ 0.01$[/direct]