Fask
Forum Replies Created
-
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldok … thank you for everything. You are available to perform some functions in PHP? I can pay
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldThis is the entire code:
I do not receive any error. The ouput is not shown, and the screen is cut in half.
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldI know, are very scarce in PHP. In any case, thank you for your time. I could not solve the problem … ??
Can you please make a post with the arrays on first post and please explain how to do it?
foreach ($videos as $i => $video) { echo '<li><a href="'.$video.'">'. ($i + 1) .'</a></li>'; }
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldfollowing your advice, the code should be this:
but does not work. There is an error in the syntax. View image:
foreach ($videos as $i => $video)
'<li><a href="'.$video.'">'.$i+1.'</a></li>'
https://img841.imageshack.us/img841/6323/sintaxerror.png
I also tried this:
echo '<a href="'.$video.'">'.$.'</a>';
but does not work.
What’s wrong?
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldThe first array is collected by get_post_meta, see image:
https://img51.imageshack.us/img51/8339/firstarray.png
sorry you’re right: the line should be this:
<li><a href="'$video'">'$name'</a></li>
$video = https://www.youtube.com/watch?v=yC3_gkdtlua ecc..
$name = 1,2,3,4 ecc…and is placed in the foreach loop:
foreach ($videos as $video)
the result is like this:
Forum: Hacks
In reply to: Foreach with multiple arrays custom fieldThe complete code has been moderated. You can see it on pastebin:
As you can see from the code, after creating a custom field value of youtube and in the textarea insert the links to your video. Each link MUST be on a new line.
The code above uses WordPress’ get_post_meta function to retrieve the custom field key. It then converts the linebreaks to html’s
<br />
tag using PHP’snl2br()
function. We then create an array with theexplode()
function using the tag as the separator of the different lines of data.Can you please make a post with the arrays on this post (pastebin) and please explain how to do it?
(sorry for my english)
same problem, running WordPress 3.1.2. developers can help us? thanks
still many bugs in this plugin. According to my point of view, the developer wanted to integrate too many functions.
for the moment I have uninstalled …. worked very badly.
you’re right. But this problem should be fixed by the developer. tonight is the version 0.9.2.4 has been released, but the problem remained.
so you think it’s just a problem of warnings?
Forum: Plugins
In reply to: Removing gravatar.comfunction bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" ' . $html_width . $html_height . ' />'; } else { return $image; } } add_filter('bp_core_fetch_avatar', 'bp_remove_gravatar', 1, 9 ); function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; return "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />"; } add_filter('get_avatar', 'remove_gravatar', 1, 5); function bp_remove_signup_gravatar ($image) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" width="60" height="60" />'; } else { return $image; } } add_filter('bp_get_signup_avatar', 'bp_remove_signup_gravatar', 1, 1 );
The image that I am referencing doesn’t have to be a PNG. The size is 150×150. You may have to adjust the file name and/or path to your liking. This speeds up your site very much.
Forum: Plugins
In reply to: [Simple Local Avatars] Disable Gravatar.comfunction bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" ' . $html_width . $html_height . ' />'; } else { return $image; } } add_filter('bp_core_fetch_avatar', 'bp_remove_gravatar', 1, 9 ); function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; return "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />"; } add_filter('get_avatar', 'remove_gravatar', 1, 5); function bp_remove_signup_gravatar ($image) { $default = get_stylesheet_directory_uri() .'/images/avatar.png'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" width="60" height="60" />'; } else { return $image; } } add_filter('bp_get_signup_avatar', 'bp_remove_signup_gravatar', 1, 1 );
Forum: Plugins
In reply to: [Plugin: User photo] front end uploadHy,
This works for me (with user-avatar plugin), list my steps:
open style your theme and add:
#user-avatar-display { background-color: #000; border:1px solid #454545; -moz-border-radius: 5px; -webkit-border-radius:5px;margin: 0 auto; padding: 0 20px 20px; position: absolute; right: 250px; text-align: center; top: 390px; } #user-avatar-display-image{ border:4px solid #323232; width:150px; height:150px; } #user-avatar-link{ float:left; margin:15px 0 15px 32px; font-size:13px; }
before </head>:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2"></script>
Download PrettyPhoto and call it before the closing tag </head>:
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/prettyPhoto.css" /> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.prettyPhoto.js"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({ theme: 'dark_square', animationSpeed: 'fast', opacity: 0.80, }); }); </script>
Call User-avatar frontend:
<div id="user-avatar-display" > <h3>Avatar</h3> <p id="user-avatar-display-image"><?php echo get_avatar( $current_user->ID, 150);?></p> <a id="user-avatar-link" href="<?php echo admin_url('admin-ajax.php'); ?>?action=user_avatar_add_photo&step=1&uid=<?php echo $current_user->ID; ?>?iframe=true&width=520&height=350" rel="prettyPhoto[iframes]">Cambia Avatar</a> </div> <script type="text/javascript"> function user_avatar_refresh_image(img){ jQuery('#user-avatar-display-image').html(img); } </script> <script type='text/javascript'> var swrAjax = { ajaxurl: "https://your_blog.com/wp-admin/admin-ajax.php" }; </script>
changes “your_blog.com” with the URL of your website
Forum: Plugins
In reply to: [Plugin: User photo] front end uploadmy fault. the trick is for user avatars, it is true