Changeset 526288
- Timestamp:
- 04/02/2012 03:43:43 PM (14 years ago)
- Location:
- wp-frontlinesms/trunk
- Files:
-
- 3 edited
-
frontlinesms.php (modified) (3 diffs)
-
frontlinesms_admin.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-frontlinesms/trunk/frontlinesms.php
r492504 r526288 39 39 40 40 add_action('admin_menu', 'frontlinesms_admin_menu'); 41 add_shortcode("wp-frontlinesms","laman_flsms"); 41 42 42 43 //to retrieve from message database 43 function ambil( )44 function ambil($bbawah,$batas) 44 45 { 45 46 global $wpdb; 46 47 $table = $wpdb->prefix."frontlinesms"; 47 $results = $wpdb->get_results("SELECT sender_number, message_content FROM $table ORDER BY dt DESC LIMIT 5",ARRAY_N); 48 $results = $wpdb->get_results("SELECT sender_number, message_content FROM $table ORDER BY dt DESC limit $bbawah,$batas ",ARRAY_N); 49 /* 48 50 for($i=1; $i<count($results); $i++) 49 51 { 50 echo $results[$i][0]." --> ".$results[$i][1]."<br>"; 51 } 52 echo $results[$i][0]." : ".$results[$i][1]."<br>"; 53 } 54 */ 55 return $results; 52 56 53 57 } 54 58 59 function penghalaman(){ 60 $hal = ambil(); 61 } 62 /******************************** 63 Widget WP-FrontlineSMS 64 */ 65 function samping_flsms(){ 66 $test = ambil(0,5); 67 68 for($i=1; $i<count($test); $i++) 69 { 70 echo $test[$i][0]." : ".$test[$i][1]."<hr />"; 71 } 72 } 55 73 56 //Widget plugins sidebar 74 /********************************* 75 Shortcode WP-FrontlineSMS 76 */ 77 function laman_flsms(){ 78 $perhal = 5; 79 $nomhal = 1; 80 global $wpdb; 81 $table = $wpdb->prefix."frontlinesms"; 82 $results = $wpdb->get_results("SELECT COUNT(sender_number) AS jumbar FROM $table",ARRAY_A); 83 $tothal = ceil($results[0]['jumbar']/$perhal); 84 if(isset($_GET['page'])) 85 { 86 $nomhal = $_GET['page']; 87 } 88 $offset = ($nomhal - 1) * $perhal; 89 $test = ambil($offset,$perhal); 90 for($i=1; $i<count($test); $i++) 91 { 92 echo 'SMS Dari '.$test[$i][0]." : ".$test[$i][1]."<hr />"; 93 } 57 94 58 error_reporting(E_ALL); 95 $self = $_SERVER['PHP_SELF']; 96 $nav = ''; 97 98 for($page = 1; $page <= $tothal; $page++) 99 { 100 if ($page == $nomhal) 101 { 102 $nav .= " $page "; // no need to create a link to current page 103 } 104 else 105 { 106 $nav .= " <a href=\"$self?page=$page\">$page</a> "; 107 } 108 } 109 echo $nav; 110 } 111 112 /**************************** 113 Widget plugins sidebar 114 */ 115 //error_reporting(E_ALL); 59 116 add_action("widgets_init", array('FrontlineSMS_widget', 'register')); 60 117 class FrontlineSMS_widget { … … 65 122 echo $args['before_widget']; 66 123 echo $args['before_title'] . 'SMS Message' . $args['after_title']; 67 echo ambil();124 echo samping_flsms(); 68 125 echo $args['after_widget']; 69 126 } … … 106 163 $wpdb->query($wpdb->prepare($send, $kk, $ss, $mm)); 107 164 */ 108 $wpdb->insert($table, array('FRONTLINE_key' => $kk, 109 'sender_number' => $ss, 110 'message_content' => $mm, 111 'dt' => $dt )); 165 $wpdb->insert($table, array('FRONTLINE_key' => $kk, 'sender_number' => $ss,'message_content' => $mm, 'dt' => $dt )); 112 166 $wpdb->show_errors(); 113 167 -
wp-frontlinesms/trunk/frontlinesms_admin.php
r492504 r526288 33 33 <br /> 34 34 <? 35 echo "<b> http://" . $_SERVER['HTTP_HOST'] . "/index.php?ss=\${sender_number}&mm=\${message_content}&kk= </b>";35 echo "<b> http://" . $_SERVER['HTTP_HOST'] . "/index.php?ss=\${sender_number}&mm=\${message_content}&kk=</b>"; 36 36 echo "<b>" . check_frontlinesms_key() . "</b><br />"; 37 37 echo "Just fill the link above to the frontlineSMS external command Http Request"; -
wp-frontlinesms/trunk/readme.txt
r487374 r526288 22 22 1. Upload `wp-frontlinesms` directory to the `/wp-content/plugins/` directory 23 23 2. Activate the plugin through the 'Plugins' menu in WordPress 24 3. Place widget to the bar 24 3. Place widget to the bar or adding shortcode [wp-frontlinesms] to a Post or Page 25 25 26 26 == Frequently Asked Questions == … … 56 56 = 0.2= 57 57 * fixing link in admin page 58 59 = 0.3 = 60 * Adding Shortcode [wp-frontlinesms] 61 * Pagination on message displayed with the short code 62 * Change the "-->" to ":" 58 63 59 64 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.