skd_sam
Forum Replies Created
-
Would it be better to use wp_enqueue_script for adding your css/script files as its the corret way to do it in wordpress?
wp_deregister_script( ‘jquery’ ); // or another custom added script
wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js’);
wp_enqueue_script(‘myjqueryscript’,’mypluginscript’,array(‘jquery’),’1.7′,false);
wp_deregister_script( ‘myjqueryscript’ ); // remove the script.Might help not sure…
I dont get the flash fullback either I used this shortcode below with firfox and just got a empty box when right clicked no flash menu came up.
[video mp4="http://urltomovie/videos/mymovie.mp4" preload="auto" autoplay="false" controls="true" id="movie-id-home-2" poster="http://video-js.zencoder.com/oceans-clip.png" width="600" height="300"]
Cheers
Just wanted to let you know I had browser issues with viewing the files if I did not add the shortcode and use webm format link before mp4 format link .. With the mp4 format link first it only played in chrome and opera but with the webm format link in shortcode first it played in all browers and on iphone just not tested in firefox.
Any idea why this is happening?
Forum: Plugins
In reply to: get plugin data from mysql databaseHi shariyaar_shah,whooami
Im stuck trying this methord but using my own database table i cant seem to pull info from my table with shariyaar_shah code but works for options table.. here is my code what am i doing wrong ?
<?php /* Plugin Name: wp-html-profile-adder Plugin URI: http://www.swipedstudio.com/wp_plugin/ Description: Plugin for adding html/xhtml code at the bottom of profile page. Version: 0.1 Author: Sam Miller Author URI: http://www.swipedstudio.com/ */ /* Copyright 2009 Sam Miller (email : skdsounds@hotmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ // Create a table for our plugin to hold the new/old html for profile page. $jal_db_version = "0.1"; // create the tables needed or activation of plugin. register_activation_hook(__FILE__,'jal_install'); function jal_install () { global $wpdb; global $jal_db_version; $table_name = $wpdb->prefix . "profile_adder"; if($wpdb->get_var("show tables like '$table_name'") != $table_name) { $sql = "CREATE TABLE " . $table_name . " ( option_id mediumint(9) NOT NULL AUTO_INCREMENT, option_name text NOT NULL, option_value text NOT NULL, UNIQUE KEY id (option_id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); $new_text = "new profile page."; $old_text = "old profile page."; $insert = "INSERT INTO " . $table_name . " (option_name, option_value) " . "VALUES ('" . $wpdb->escape('new_text') . "','" . $wpdb->escape($new_text) . "')"; $results = $wpdb->query( $insert ); $insert = "INSERT INTO " . $table_name . " (option_name, option_value) " . "VALUES ('" . $wpdb->escape('old_text') . "','" . $wpdb->escape($old_text) . "')"; $results = $wpdb->query( $insert ); add_option("jal_db_version", $jal_db_version); $installed_ver = get_option( "jal_db_version" ); if( $installed_ver != $jal_db_version ) { $sql = "CREATE TABLE " . $table_name . " ( option_id mediumint(9) NOT NULL AUTO_INCREMENT, option_name text NOT NULL, option_value text NOT NULL, UNIQUE KEY id (option_id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); update_option( "jal_db_version", $jal_db_version ); } } } // adding menus to the admin panel for editing the database add_action('admin_menu', 'my_plugin_menu'); /// adding the menu form to for the plugin function my_plugin_menu() { add_options_page('My Plugin Options', 'Profile html', 9, 'profile_adder_id', 'my_plugin_options'); } function my_plugin_options() { echo '<div class="wrap">'; echo '<h2>html for the bottom of the profile page.</h2>'; echo '<p>This plugin allows you to add some html or text to the bottom of the profile page, I use this for help panel in proflie page and made this plugin so when i upgrade wordpress i dont have to edit the page manualy.</p><br />'; echo '<h3>New html header for profile page.</h3>'; echo '<form method="post"><textarea style="width: 600px; height: 120px;"></textarea><br /><br /><input type="submit" name="submit" value="Submit" /></form>'; echo '<h3>Old html header for profile page.</h3>'; echo '<textarea style="width: 600px; height: 120px;"></textarea>'; echo '</div>'; function sample_function() { global $wpdb; // wordpress pull data this works ! $res = $wpdb->get_results("SELECT option_value FROM $wpdb->options WHERE option_id = '4'"); foreach ($res as $rs) { echo $rs->option_value; } // my pull data this dont work! $ress = $wpdb->get_results("SELECT option_value FROM $wpdb->profile_adder WHERE option_id = '1'"); foreach ($ress as $rss) { echo $rss->option_value; } } sample_function(); } ?>