Search the Community
Showing results for tags 'change'.
-
Hello, I want to know how they keep the same url when page is changing, if you dont know what i mean try the link and check the browser when you wat happens when you click in a other link in the website. ( Website Link ( Normal Content ) ) http://geedmo.com/?item=LushSlider Thanks in advance.
-
Hi there, Apologies if this is in the wrong section, not sure what would cover it aha I have a client who would like to be able to update her photos in the gallery weekly, and possibly update any text on the site herself (description etc). What is the best way to go about this? She used a site builder to get it up and running, but I don't have access to the host, so I don't have access to databases or know if they allow PhP. Would an admin panel be the best way about this? If so, would anyone mind talking me through a rough step-by-step of the process?
-
Hello, i have a question about how to change from database a row wich contains the duration of videos. I have videos with time in table row duration like this here below: Table: Duration 5:00 300 this should be like this > 3:00 < min 10:00 2000 this should be like this > 20:00 < 20 min 10000 this should be like this > 1:00:00 < 1 hour and so on. But when i echo out it show me like in the table row exactly. here is an exmple of my scrip: <?php $thumbs = $runrows ['thumbs']; $title = $runrows ['title']; $url = $runrows ['url']; $duration = $runrows ['duration']; while($runrows = mysql_fetch_assoc($getquery)) { echo '<li class="thumbcontent"><a href="'. $runrows['url'] .'" ><img src="'. $runrows['thumbs'].'" class="thumb" name="'. $runrows['title'] .'" alt="'. $runrows['title'] .'" title="'. $runrows['title'] .'" width="240" height="180" /> </a> <span class="duration">'. $runrows['duration'].'</span></li> '; } echo "<center>"; ?> And this is what a friend send me to check out but i cant figure out how to fit this code with my own code. <?php foreach (array(500, 234, 1100, 520, 1300, 10000) as $number) { echo $number, "\t"; $number = str_pad($number, 6, 0, STR_PAD_LEFT); echo ltrim($number{0}.$number{1}.':'.$number{2}.$number{3}.':'.$number{4}.$number{5}, ":0"), "\n"; } or this: foreach (['500', '234', '1100', '520', '1300', '10000'] as $number) { $time = strrev($number); $time = wordwrap($time, 2, ':', true); $time = strrev($time); echo "$number was transformed to $time\n"; } I hope i explained it well, i hope somebody can help me with a solution. Thanks in advance.
-
Hi all, Today I switched servers. I got a Hostgator Basic Dedicated server, and their migration team moved everything over for my website - including the MySQL database - from their congested shared servers to my new one. I went to my registrar and changed the DNS entries to point to the new private nameservers. Accessed the CPanel, saw the files, was able to modify them and see the changes at the url level. All looked good. Now, here's what's weird: SOME of the pages of my site run the MySQL queries just fine. Some do not. For example, I have a page called "kids rugs" that shows a few hundred rugs pulled straight from my database. Each shows the photo, the name, and the price. But when you click on an individual rug, and it takes you to the detail page? NO data of any kind is showed (no photo, no description, no price, etc...) The second page is running the same type of query as the first. It's a SELECT * FROM tbl_name WHERE category = 'rugs'. The table is the same, the database is the same, and the connection script is the same. But one page shows results from the inquiry where the other does not. There are lots of other pages on my site that refuse to run MySQL inquires as well. These were all inquiries that worked flawlessly on the old shared server, but don't work on the new dedicated one (both servers are Linux). My question is this: Do you think this has anything to do with DNS, non-propagation, etc? I'm tempted to say "oh, this will resolve itself in 24-48 hours", but then again, it doesn't make much sense that a MySQL query would connect and work correctly on one page, and not show any results on others. Any ideas? Thanks in advance for the help!
-
I am currently working off of a Wordpress template from Gavick. Here is the website: earthcharterfest.com/wordpress Within the homepage of the site, there is a widget that displays five circular containers under the header "Venues". The containers hold images that move one by one from the right to the left every few seconds or so. The content within the containers is determined by Wordpress "posts" within the Widget. So for every post I create, a new container is also created. What I would like to do is, instead of having the containers move left to right one by one, to make them move five containers at a time. This way I can have images all related to a single venue, and have other sets of images for various venues. I was told that in order to do this that these files must be edited: /wp-content/themes/Fest/gavern/widget.speakers.php is the file that generates content, /wp-content/themes/Fest/js/widgets/speakers.js is a jQuery file that creates animation. However, I have very little experience with both Javascript and PHP. Can anyone be of assistance? Below are the two files that deal with the Circular Container Widget. Gavick calls this widget the Speakers Widget. Website: earthcharterfest.com/wordpress /wp-content/themes/Fest/js/widgets/speakers.js: // // GK Speakers Widget // jQuery(window).load(function(){ jQuery(document).find('.widget_gk_speakers').each(function(i, widget) { new GK_Speakers(jQuery(widget)); }); }); function GK_Speakers(widget) { this.$G = null; this.current_offset = 0; this.anim_interval = 0; this.current = 0; this.total = 0; this.items = []; this.availableItems = null; this.hover = false; this.$G = { 'animation_speed': 500, 'animation_interval': 5000, }; this.current_offset = 0; this.anim_interval = this.$G['animation_interval']; this.current = 4; this.total = widget.find('.gkw-rest-speakers .gkw-speaker').length; // if there is more than 5 slides if(this.total > 5) { // prepare handlers this.items[0] = widget.find('.gkw-speakers-small-left .gkw-speaker-small').first(); this.items[1] = widget.find('.gkw-speakers-small-left .gkw-speaker-small').first().next(); this.items[2] = widget.find('.gkw-speakers .gkw-speaker-big').first(); this.items[3] = widget.find('.gkw-speakers-small-right .gkw-speaker-small').first(); this.items[4] = widget.find('.gkw-speakers-small-right .gkw-speaker-small').first().next(); // this.availableItems = widget.find('.gkw-rest-speakers .gkw-speaker'); // var $this = this; // jQuery(this.items).each(function(i, el) { jQuery(el).removeClass('speaker-hide'); }); // run the animation setTimeout(function() { $this.gkChangeSpeakers(); }, this.anim_interval + 400); jQuery(this.items).each(function(i, el) { jQuery(el).mouseenter(function() { $this.hover = true; }); jQuery(el).mouseleave(function() { $this.hover = false; }); }); } } GK_Speakers.prototype.gkChangeSpeakers = function() { // var $this = this; // if(!this.hover) { // hide speakers jQuery(this.items).each(function(i, el) { jQuery(el).addClass('speaker-hide'); }); if(this.current < this.total - 1) { this.current += 1; } else { this.current = 0; } setTimeout(function() { var IDs = [0, 0, 0, 0, 0]; IDs[4] = $this.current; totalOffset = $this.total; IDs[3] = ($this.current - 1 < 0) ? --totalOffset : $this.current - 1; IDs[2] = ($this.current - 2 < 0) ? --totalOffset : $this.current - 2; IDs[1] = ($this.current - 3 < 0) ? --totalOffset : $this.current - 3; IDs[0] = ($this.current - 4 < 0) ? --totalOffset : $this.current - 4; jQuery($this.items[0]).html(jQuery($this.availableItems[IDs[0]]).html()); jQuery($this.items[1]).html(jQuery($this.availableItems[IDs[1]]).html()); jQuery($this.items[2]).html(jQuery($this.availableItems[IDs[2]]).html()); jQuery($this.items[3]).html(jQuery($this.availableItems[IDs[3]]).html()); jQuery($this.items[4]).html(jQuery($this.availableItems[IDs[4]]).html()); }, 600); // show speakers setTimeout(function() { jQuery($this.items).each(function(i, el) { jQuery(el).removeClass('speaker-hide'); }); }, 750); } // setTimeout(function() { $this.gkChangeSpeakers(); }, this.anim_interval + 800); }; /wp-content/themes/Fest/gavern/widget.speakers.php: <?php /** * * GK Speakers Widget class * **/ class GK_Speakers_Widget extends WP_Widget { /** * * Constructor * * @return void * **/ function GK_Speakers_Widget() { $this->WP_Widget( 'widget_gk_speakers', __( 'GK Speakers', GKTPLNAME ), array( 'classname' => 'widget_gk_speakers', 'description' => __( 'Use this widget to show rotator with speakers', GKTPLNAME) ) ); $this->alt_option_name = 'widget_gk_speakers'; add_action( 'save_post', array(&$this, 'refresh_cache' ) ); add_action( 'delete_post', array(&$this, 'refresh_cache' ) ); add_action('wp_enqueue_scripts', array('GK_Speakers_Widget', 'add_scripts')); } static function add_scripts() { wp_register_script( 'gk-speakers', get_template_directory_uri() . '/js/widgets/speakers.js', array('jquery')); wp_enqueue_script('gk-speakers'); } /** * * Outputs the HTML code of this widget. * * @param array An array of standard parameters for widgets in this theme * @param array An array of settings for this widget instance * @return void * **/ function widget($args, $instance) { $cache = get_transient(md5($this->id)); // the part with the title and widget wrappers cannot be cached! // in order to avoid problems with the calculating columns // extract($args, EXTR_SKIP); $title = apply_filters('widget_title', empty($instance['title']) ? __( 'Speakers', GKTPLNAME ) : $instance['title'], $instance, $this->id_base); echo $before_widget; echo $before_title; echo $title; echo $after_title; if($cache) { echo $cache; echo $after_widget; return; } ob_start(); // $category = empty($instance['category']) ? '' : $instance['category']; $anim_speed = empty($instance['anim_speed']) ? 500 : $instance['anim_speed']; $anim_interval = empty($instance['anim_interval']) ? 5000 : $instance['anim_interval']; // $gk_loop = new WP_Query( 'category_name=' . $category . '&post_type=gavern_speakers'); $speakers = array(); while($gk_loop->have_posts()) { $gk_loop->the_post(); array_push($speakers, array( 'title' => get_the_title(), 'img' => wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()) ), 'url' => get_permalink() )); } wp_reset_postdata(); if (count($speakers)) { if(count($speakers) >= 5) { echo '<div class="gkw-speakers"> <div class="gkw-speaker-big speaker-hide"> <div> <a href="'.$speakers[2]['url'].'"> <img src="'.$speakers[2]['img'].'" alt="'.$speakers[2]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[2]['url'].'" title="'.$speakers[2]['title'].'">'.$speakers[2]['title'].'</a> </h4> </div> <div class="gkw-speakers-small-left"> <div class="gkw-speaker-small speaker-hide"> <div> <a href="'.$speakers[0]['url'].'"> <img src="'.$speakers[0]['img'].'" alt="'.$speakers[0]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[0]['url'].'" title="'.$speakers[0]['title'].'">'.$speakers[0]['title'].'</a> </h4> </div> <div class="gkw-speaker-small speaker-hide"> <div> <a href="'.$speakers[1]['url'].'"> <img src="'.$speakers[1]['img'].'" alt="'.$speakers[1]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[1]['url'].'" title="'.$speakers[1]['title'].'">'.$speakers[1]['title'].'</a> </h4> </div> </div> <div class="gkw-speakers-small-right"> <div class="gkw-speaker-small speaker-hide"> <div> <a href="'.$speakers[3]['url'].'"> <img src="'.$speakers[3]['img'].'" alt="'.$speakers[3]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[3]['url'].'" title="'.$speakers[3]['title'].'">'.$speakers[3]['title'].'</a> </h4> </div> <div class="gkw-speaker-small speaker-hide"> <div> <a href="'.$speakers[4]['url'].'"> <img src="'.$speakers[4]['img'].'" alt="'.$speakers[4]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[4]['url'].'" title="'.$speakers[4]['title'].'">'.$speakers[4]['title'].'</a> </h4> </div> </div> </div> <div class="gkw-rest-speakers">'; for($i = 0; $i < count($speakers); $i++) { echo '<div class="gkw-speaker"> <div> <a href="'.$speakers[$i]['url'].'"> <img src="'.$speakers[$i]['img'].'" alt="'.$speakers[$i]['title'].'" /> </a> </div> <h4> <a href="'.$speakers[$i]['url'].'" title="'.$speakers[$i]['title'].'">'.$speakers[$i]['title'].'</a> </h4> </div>'; } echo '</div>'; } } // save the cache results $cache_output = ob_get_flush(); set_transient(md5($this->id) , $cache_output, 3 * 60 * 60); // echo $after_widget; } /** * * Used in the back-end to update the module options * * @param array new instance of the widget settings * @param array old instance of the widget settings * @return updated instance of the widget settings * **/ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['category'] = strip_tags( $new_instance['category'] ); $instance['anim_speed'] = strip_tags( $new_instance['anim_speed'] ); $instance['anim_interval'] = strip_tags( $new_instance['anim_interval'] ); $this->refresh_cache(); $alloptions = wp_cache_get('alloptions', 'options'); if(isset($alloptions['widget_gk_speakers'])) { delete_option( 'widget_gk_speakers' ); } return $instance; } /** * * Refreshes the widget cache data * * @return void * **/ function refresh_cache() { delete_transient(md5($this->id)); } /** * * Limits the comment text to specified words amount * * @param string input text * @param int amount of words * @return string the cutted text * **/ function comment_text($input, $amount = 20) { $output = ''; $input = strip_tags($input); $input = explode(' ', $input); for($i = 0; $i < $amount; $i++) { $output .= $input[$i] . ' '; } return $output; } /** * * Outputs the HTML code of the widget in the back-end * * @param array instance of the widget settings * @return void - HTML output * **/ function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $category = isset($instance['category']) ? esc_attr($instance['category']) : ''; $anim_speed = isset($instance['anim_speed']) ? esc_attr($instance['anim_speed']) : ''; $anim_interval = isset($instance['anim_interval']) ? esc_attr($instance['anim_interval']) : ''; ?> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', GKTPLNAME ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>"><?php _e( 'Category slug:', GKTPLNAME ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'category' ) ); ?>" type="text" value="<?php echo esc_attr( $category ); ?>" /> </p> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'anim_speed' ) ); ?>"><?php _e( 'Animation speed (in ms):', GKTPLNAME ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'anim_speed' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'anim_speed' ) ); ?>" type="text" value="<?php echo esc_attr( $anim_speed ); ?>" /> </p> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'anim_interval' ) ); ?>"><?php _e( 'Animation interval (in ms):', GKTPLNAME ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'anim_interval' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'anim_interval' ) ); ?>" type="text" value="<?php echo esc_attr( $anim_interval ); ?>" /> </p> <?php } } // EOF
- 1 reply
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
Hey All, I have built a website using PHP and MySQL where users have to log in to use the site. I'm now trying to create a page on the site where logged in users can change their password if they need/want to. I thought this would be fairly easy and straight forward but I'm having a ton of issues. I've never been formally trained in PHP and MySQL, I've just picked up stuff along the way throughout the years so when I get into advanced stuff I start to struggle. I'm using MD5 hashing for the passwords right now. I already know this isn't the most secure method but since I'm familiar with it I'm just going to go with it for now. I'll worry about changing the hashing later. Anyway, the PHP code lives on the same page as the form. The HTML portion of the form has the following fields: Current Password (id="cur_password") New Password (id="password1") Confirm New Password (id="password2") Within the script I'm trying to verify that the Current Password and the password in the database match, but because of the MD5 I'm not exactly sure how to do this. Here is what I have so far: $sql = "SELECT * FROM users WHERE username='$log_username'"; $query = mysqli_query($db_conx, $sql); while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) { $username = $row[username]; $password = $row[password]; } $cur_password=md5($_POST['cur_password']); $password1=md5($_POST['password1']); $password2=md5($_POST['password2']); if (empty ($_POST['cur_password'])){ echo "Fill out all fields."; } else if ($cur_password != $password) { echo "There was a problem. Wrong Password."; } else if ($passord1 != $password2) { echo "Passords don't match."; } else { $sql = "UPDATE users SET password = MD5('$password1') WHERE username='$log_username' LIMIT 1"; $query = mysqli_query($db_conx, $sql); echo "Success! Password has been changed."; } When I test I keep getting the "Fill out all fields." message even though I submitted the form and none of the fields were blank. If I take the "empty" statement out I just keep getting the "There was a problem. Wrong Password." message which should happen only if the current password typed in and the current password in the database don't match. I know that I'm putting in the correct matching password. Anyway, any help you could give would be greatly appreciated. Thanks so much.
-
Hi, can anybody tell me if its possible to change the currency symbol from $ to £ within this plug-in in a wordpress website? Or how am I able to locate .php file its located in? http://www.lettingagentsbournemouth.co.uk/residential-lets/#/1830722466 Many thanks
- 1 reply
-
- currency symbol
- php
-
(and 2 more)
Tagged with: