Gustavo Lanzas
Forum Replies Created
-
Forum: Plugins
In reply to: [CAS Maestro] has_cap deprecated since version 2.0.0Hey Joe – I fixed this a few months back for an instance I run for a college library website. The issue is where the menu page and options page are added. In the current code, it uses a numeric capability (which is deprecated). I replaced it with a named capability (‘manage_options’), and was able to fix the issue.
You can find the menu page code around line #432, and the options code around line #443 of cas-maestro.php
Old:
$settings_page = add_options_page(__('CAS Maestro', "CAS_Maestro"), __('CAS Maestro', "CAS_Maestro"), 8, 'wpcas_settings', array(&$this,'admin_interface'));
Updated:
$settings_page = add_options_page( __('CAS Maestro', "CAS_Maestro"), __('CAS Maestro', "CAS_Maestro"), 'manage_options', 'wpcas_settings', array(&$this,'admin_interface') );
Hope this helps!
Forum: Fixing WordPress
In reply to: java exploit hack in wp 3.3. betaTekno23 – thank you so much for doing that! Worked great, and I had a LOT of sites to run it on.
Does anyone have any idea how this code is getting injected in?
Forum: Plugins
In reply to: [Timely All-in-One Events Calendar] [Plugin: All-in-One Event Calendar] CSSYou guys should do what almost everyone else (like the events calendar) does and allow the user to copy template / css files to the theme directory, and edit them there. It’s not too hard to have your plugin check to see if the files are there before rendering.
This is pretty much a foolproof way of letting users have full customization control, and you don’t have to worry about breaking anything when there’s an update.
Forum: Plugins
In reply to: [Custom Field Template] [Plugin: Custom Field Template] Multiple custom fieldYou can create a lot more than two templates – not sure how many, but the plugin will keep adding one more blank template to the admin as you fill them in.
Not sure what you mean by “formats”.
I’m having the same exact problem here. Not sure when this started happening, since the site has been running for some time. Using WP 3.2.1 and TEC 1.6.5.
Forum: Fixing WordPress
In reply to: [Plugin: Custom Field Template] File and Image DisplayLinicio – all you have to do is wrap an if statement around the button:
<?php if($downloadlink = get_post_meta($post->ID, 'download_link', true)) { ?> <a href="<?php echo $downloadlink; ?>">Download</a> <?php }; ?>
if you want it to do something else instead of just disappear, replace the last line with:
<?php } else { ?> <b>Nothing to download here!</b> <?php }; ?>
Mfro – it goes in gallery.php. However, please keep in mind that the code as above doesn’t work 100% – it only works when you’re navigating to a gallery from an album, embedded in the same page.
I may have a much better solution soon – but I’m under deadline right now, so it will take me a little bit to post. ??
I have a very convoluted way of doing this right now, but it works fine as long as you navigate to the gallery from an album. I’m sure there’s a much easier, elegant way of doing this. ??
Does anyone have any idea how to pull $album into the gallery template? I’m doing this right now:
$album = nggdb::find_album( get_query_var('album') );
And it only seems to grab it when you navigate from an album.
<?php /* create album navigation */ $slug = basename(get_permalink()); $galleries = array(); $query = "SELECT * FROM <code>wp_ngg_gallery</code> ORDER BY <code>wp_ngg_gallery</code>.<code>gid</code> ASC"; $result = mysql_query($query) or die(mysql_error()); ?> <div class="gallery_navigation"> <?php /* create array with results keyed by gid */ while($row = mysql_fetch_array($result)){ $galleries[$row['gid']] = stripslashes($row['title']); }; /* build links for galleries */ foreach ( $album->gallery_ids as $gals ) { $nav .= '<li class="menu-item"><a href="'.get_bloginfo('url').'/photo-galleries/'.$slug.'/?album='.$album->id.'&gallery='.$gals.'">'.$galleries[$gals].'</a></li>'; }; ?> <ul class="menu"> <li class="title"><?php echo $album->name.":"; ?></li> <?php echo $nav; ?> </ul> <script> // add current location to gallery navigation jQuery(window).load( function() { jQuery("ul.menu li.menu-item:contains('<?php echo $gallery->title; ?>')").addClass("current"); } ); </script> </div> <!-- end gallery navigation -->
Thanks,
Gustavo
Forum: Fixing WordPress
In reply to: Incompatible archive: PCLZIP_ERR_BAD_FORMAT (-10)Hello, I had the same problem since 2.8.2, and I solved it by commenting out mbstring.func_overload in my php.ini file:
; mbstring.func_overload = 7
Upgrades and uploads worked perfectly after that.