Code Monkey home page Code Monkey logo

magic-fields's People

Contributors

bigfive avatar chuyskywalker avatar doublesharp avatar gnuget avatar hunk avatar ignoch avatar joehoyle avatar kevinsperrine avatar leocaseiro avatar traversal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

magic-fields's Issues

Replace Prototype code with jQuery code

Currently, Margic-Fields uses both Prototype and jQuery javascript libraries. IMHO, this is an unecesary overload (because js files are loaded not only in the admin area, but in the front area too).

So my issue is about remove prototype calls and change them to jQuery calls, mainly because of Wordpress native use of jQuery in the admin area, lots of plugins use jQuery too.

Whis list feature

Hi, I would be interested to use the Magic Fields functionality and to create custom panels and custom fields but for users not for posts or pages. So it would be more or less identical except all metadata would be in the user metadata table, there is no possibility to add a new "post" but only to edit custom fields for an existent user.

Separately I would create some posts to display the user metadata based on current user ID or based on a supplied user ID such as the post author user ID.

I am not sure if this would be a hard work or a simple work from your side. If it is possible and you point me in the right direction I would try to do the modifications myself.

wish list feature

Hi, I would be interested to use the Magic Fields functionality and to create custom panels and custom fields but for users not for posts or pages. So it would be more or less identical except all metadata would be in the user metadata table.

I am not sure if this would be a hard work or a simple work from your side. If it is possible and you point me in the right direction I would try to do the modifications myself.

Duplicating a field causes Javascript error: Unknown pseudo-class or pseudo-element 'input'.

I have a text field that I'm using as an address line and when I click the "(+) Duplicate" link beneath it, the follow error message appears twice;

Warning: Unknown pseudo-class or pseudo-element 'input'.
Source File: http://example.com/wp-admin/page.php?action=edit&post=23
Line: 0

I'm using Firefox 3.5.8 on Windows XP SP3 with Magic Fields 1.3.1 on WordPress 2.9.2

I'm not strong with debugging jQuery so I'll leave this for others

Regards,
Brenden

WP Gallery not working?

Am I right in thinking that the WP Gallery function is not availible from the Image (Upload Media) Field?
Or is there perhaps something I am missing?
Thanks,
Mike

Creating filters or dropdowns of all values from a Write Panel

Say for instance, I would like to take all the text-fields of every value in a writepanel text field and use it as a filter, I seem to missing if this is a possiblity to do this or not based on how it is implemented. Any help would be appreciated?

Date field initialization

Hi,

I would like to get rid of the date field initializing with current date. I have a write panel with lots of date fields for ongoing use, so I need the unnecessary fields initialized with something like 01-Jan-70 or so, then I can easily hide them via css. Currently I need to scan all date fields and click on the Clear button to empty them...

Regards,
Richard

Group cannot be duplicated.

Running WP 3.0.1 on PHP 5.2.8. All plugins are deactivated except for Magic Fields and still can't duplicate a group. What's odd is, it is working perfectly on a clone site on the same server. Your help will be greatly appreciated. Thanks!

Duplicating a group causes PHP require() "No such file or directory" error in RCCWP_GetDuplicate.php

This error appears to occur when the wp-config.php file is located outside (up one level) from the WordPress root directory. This is a security feature of WordPress that Magic Fields does not handle correctly.

To resolve this issue, I have replaced the following line in RCCWP_GetDuplicate.php;

require( dirname(__FILE__) . '/../../../wp-config.php' );

with new code;

// define ABSPATH to accommodate the upcoming require_once of wp-settings.php
define('ABSPATH', dirname(__FILE__) . '/../../../' );

// seek out and require_once the wp-config.php file
if ( file_exists( dirname(__FILE__) . '/../../../wp-config.php' ) ) {
    // The config file resides in WP root
    require_once( dirname(__FILE__) . '/../../../wp-config.php' );
} elseif ( file_exists( dirname(__FILE__) . '/../../../../wp-config.php' ) ) {
    // The config file resides one level above WP root (more secure if outside public_html/equivalent)
    require_once( dirname(__FILE__) . '/../../../../wp-config.php' );
} else {
    // A config file doesn't exist, die with an error message
    die("There doesn't seem to be a wp-config.php file. I need this to continue.");
}

I've tested it with the wp-config.php file in both locations and it works correctly for each. The code supplied might need some formatting changes to suite the coding style of Magic Fields plugin or WordPress itself.

Active (sub)menu in administration

When I create new post type (e.g. Course) and I press Manage the right submenu is expanded in the admin interface. When I'm adding new course or editing the course then the Posts menu is expanded instead of Courses.

I checked the URL for content type created with WP API by hand and it looks the same even for custom post types (post.php?post=63&action=edit). The solution has to be in javascript somewhere. Anyone has an idea where/how to fix this?

Wordpress 3.0.1, Magic Fields 1.4.5-head

Duplicating '_mf_wirte_panel_id' in wp_postmeta

With brand new wordpress 3 when i create a post with magic fields and save it everything is ok.
When i go edit and update the post it creates another '_wp_mf_write_panel_id' row in the 'wp_postmeta' table without removing the old one, the two rows have just different 'meta_id'.
If you use Wordpress as a CMS and do personal queries to db this means that everytime you try to get all posts from a magic-fields panel it gives you back double result for each post.
Hope you understand :)
Anyway magic-fields rocks thanks a lot

div nesting bug with "Hide Visual Editor for this Field" turned on

Line 779 of RCCWP_WritePostPage.php causes big problems with

nesting when the "Hide Visual Editor for this field:" checkbox is selected on a Multiline field.

The line reads:

It should be changed to:

The reason for this is that the 2nd closes the

on line 766:

But this

is within the if statement on line 74:
if(!$hideEditor){

So the second div should be closed conditionally too, as shown above.

I have tested this solution, and it works for me. There's a big chance this bug may be related to some of the other unresolved issues here too, since improper

nesting is likely to make the jQuery code for drag and drop grouping fail.

Page template setting not saved creating a Page Write Panel

If you create a new write panel of Page type and select a page template different from the default page template, the plugin doesn't save this setting. You have to set the template for each istance of this write panel through the standard wordpress page interface.

Wordpress 2.9.2

Magic-Fields 1.4
qTranslate 2.5.7
qTranslate META 0.8.3
Google XML Sitemaps with qTranslate Support 3.1.6.3
TinyMCE Advanced 3.2.7
TinyMCE Excerpt 1.33

Php 5.2.4
Mysql 5.0.51a

Problem exporting data from write panels

I've found a bug using Write Panels Export function: on my ubuntu web server, it returns a zero byte file cause it tries to write a file in the /tmp directory on the server, before output it to the browser.
I've configured several virtual-hosts on the same machine, so I've setted up a different tmp directory for each virtual-host, for security reason, using "upload_tmp_dir" php ini directive.
But your export function ignores this directive.

In your RCCWP_Processor.php, on line 119 (on the last master) Magic Fields retrieves the temporary path using sys_get_temp_dir() function.

As mentioned on php manual "This function (sys_get_temp_dir()) does not account for virtual-host-specific modifications to the temp path and/or open_basedir:

php_admin_value open_basedir /home/user php_admin_value upload_tmp_dir /home/user/tmp php_admin_value session.save_path /home/user/tmp

Within this config it still returns /tmp"
So, after some tries with different functions I came up with this working patch; I've changed the line 119 of RCCWP_Processor.php

FROM
$exportedFilename = $tmpPath = sys_get_temp_dir().DIRECTORY_SEPARATOR. $writePanel->name . '.pnl';

TO
$exportedFilename = $tmpPath = realpath( ini_get('upload_tmp_dir') ).DIRECTORY_SEPARATOR. $writePanel->name . '.pnl';

and now it works great, I can export Write Panels.

Gallery image order fields gone

In WordPress 3.0.1, the gallery image order fields (in the "Order" column of the Gallery tab of the image upload window) are missing when Magic-Fields is installed. Without those fields, the gallery images cannot be assigned a number order.

File URL hidden

When adding images through the normal Wordpress media upload interface, the file URL is hidden. Even after the media is added, clicking 'edit' does not show the file URL either.

Magic Fields 1.4.5
Wordpress 3.01

Translation in german?

Could you please start a translation file in german. I can help you finish this translation. I don't know how to start. Thanks!.

Upload percentage

It'd be great to have a % complete for the uploads of images, and particularly, larger MP3s, much like WordPress currently has for uploads. Is this possible?

Assigning write panel to pages afterwards causes wrong redirection

When you assign a custom write panel to a page that is created without a custom write panel, you get redirected to "wp-admin/page.php?" which doesn't exist anymore in the newer versions of Wordpress.

In "RCCWP_Processor.php" line 24 and 33 should be changed from:

wp_redirect($ptype.'.php?action ...
&
wp_redirect($type->type.'.php?action ...

To

wp_redirect('post.php?action ...

phpThumb could not resize jpg images

Somehow the gen_image() only work for png and gif images and does not work for jpg images.

Also, in version 1.4 beta: I noticed in phpThumb.php

//The file must be "jpg" or "png" or "jpg"
if(!in_array($extension,array('jpg','png','jpg'))){
return false;
}

it should be:

//The file must be "jpg" or "png" or "gif"
if(!in_array($extension,array('jpg','png','gif'))){
return false;
}

Missing Post Menu Options - Add New, Categories, Post Tags

Now Its working fine except one thing. When i activate the plugin, it shows “Posts” but it removes the sub menus [Add New, Categories, Post Tags] from the menu option. Below that, it shows magic field name. When the plugin is Deactivated, it works normal again (i.e. it shows sub menus [Add New, Categories, Post Tags] inside the Post menu ) is it so? or its an error? Please let me know.

Attached image for ref.:
http://i53.tinypic.com/20t2l9f.jpg

Publish date

I am using Magic Fields on a site for a client and something odd is going on. When I go to create a new page (using the custom panel) the publish date is wrong...sort of. When I click to edit the publish date, it shows that the month selected is 12 instead of 02. After clicking cancel then trying to edit the publish date again, it shows the correct month. Strange huh?

I viewed the source and noticed that while the month 02 input has selected="selected", the month 12 input has selected="" which seems to be throwing everything off. Another strange this is that we added quite a few pages using the custom write panel, and it worked fine. Now when we try to add a page, they are always scheduled to be published in December.

Any ideas on this? I've looked around in of the files and couldn't find anything suspicious...

Numbers before upload file

Hey guys, when uploading files it adds a string of numbers before them. I know this is to avoid duplicates, but would it be possible to split the files up into sub-folders by year/month, much like Wordpress currently does? I find the numbers messy, and am not sure of their impact on SEO. THanks!

Expand the right admin menu

When I create new post type (e.g. Course) and I press Manage the right submenu is expanded in the admin interface. When I'm adding new course or editing the course then the Posts menu is expanded instead of Courses.

I checked the URL for content type created with WP API by hand and it looks the same even for custom post types (post.php?post=63&action=edit). The solution has to be in javascript somewhere and it looks like JS variables pagenow and typenow are responsible for expanding the right menu.

Anyone has an idea how to fix this?

Wordpress 3.0.1, Magic Fields 1.4.5-head

Post cannot be saved

A post can't be saved as the magic field stays "required" even if filled. It is a conflict with qTranslate I guess.

Image custom resize parameters wl,hl,wp,hp

After upgrade from 1.3.1 to 1.4.5, my resized image stopped being resized.

I'm using custom paramters wl, hl, wp & hp.

I've seen that aux_image() function have been rewritten, I didn't understand everything there but I believe this is part of the problem.

Importing Write Panels don't work

After selecting a previously exported Write Panel and clicking on the "Import a Write Panel" button, I am presented with "Click here to edit the write panel.". After clicking, I am presented with an empty Write Panel table.

Apparently nothing gets imported, as the database tables are all empty.

Better TinyMCE Integration for Multiline Fields

Hi there guys,

One thing I have found frustrating in Magic Fields was that the Multiline (TinyMCE) text fields don't respect any of the plugins you have installed, nor do they respond to any custom filters setup in wordpress. Items 5 and 8 on the Wish List ( http://wiki.magicfields.org/doku.php?id=wish_list ) are related to this problem.

After scratching my head for a few hours, and digging through both the WP core source code and Magic Fields, I believe I may have come up with a good solution for this, although it probably needs a bit more testing (currently working for me though)

Currently, you initialize tinyMCE in 2 places in your JavaScript source code. In the "add_editor_text" function inside "js/groups.js":

add_editor_text = function(){
     tinyMCE.init({
        mode:"specific_textareas", editor_selector:"pre_editor", .... ETC
});   

...

and in the jQuery DOM ready function in "js/custom_fields/editor_validate.js":

jQuery().ready(function() {
    jQuery("#publish").live('click',check_textarea);

    tinyMCE.init({
        mode:"specific_textareas", editor_selector:"pre_editor", ... ETC
    });

....

The reason TinyMCE in Magic Fields doesn't respect Wordpress plugins and filters related to TinyMCE is because you're using a custom object hash to initialize TinyMCE (I'm sure you understand that already, just noting it here)

When going through WP's core, I noticed that Wordpress creates a global JavaScript variable called "tinyMCEPreInit" which has an important property "mceInit" which is THEIR tinyMCE.init object after all filters have been applied. One of the great things about this object is that it contains references to any TinyMCE plugins that are used by Wordpress plugins (for example Viper's Video Quicktags has a few custom TinyMCE plugins). It ALSO contains any references to custom stylesheets used to style the editor in a particular way, which now seems much easier in WP 3.0, with the "add_editor_style()" function and "editor-style.css" CSS file in your theme.

Anyway, what I found is that if you change both init calls to the following code, you'll get the same set of buttons, plug-ins, and editor styles that are used for the main post area:

tinyMCE.init(
    jQuery.extend(true, {}, tinyMCEPreInit.mceInit, { editor_selector: "pre_editor" })
); 

Note: the object passed in init above EXTENDS the tinyMCEPreInit.mceInit object with a custom "editor_selector" property necessary for your specific Magic fields textareas.

I've tested this on non-grouped fields, grouped fields, duplicated fields, duplicated groups, and all of them seem to work really well. Also, I've tried embedding YouTube videos using Viper's Video Quicktags in these Multiline fields, and everything comes through perfectly just like the main post content!

I'd be interested to hear your thoughts, and hopefully you can bring this code into the next beta of Magic Fields :)

Cheers

Trav

Internal Image Resize (MF_thumb.php) loses transparency in PNG & GIF files. (v1.4.1)

When uploading an image with transparency in an image field, the resulting files lose their transparent pixels, which are replaced by black.

A fix for a different WP plugin found on the WordPress forums (http://wordpress.org/support/topic/337341) also fixes this:

In the function image_resize in magic-fields/MF_thumb.php, add the following code:

    imagealphablending($newimage, false);
    imagesavealpha($newimage, true);
    $transparent = imagecolorallocatealpha($newimage, 255, 255, 255, 127);
    imagefilledrectangle($newimage, 0, 0, $dst_w, $dst_h, $transparent);

Between these two lines, which you'll find around line 39:

    $newimage = imagecreatetruecolor( $dst_w, $dst_h );
    imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);

So you end up with:

    $newimage = imagecreatetruecolor( $dst_w, $dst_h );
    imagealphablending($newimage, false);
    imagesavealpha($newimage, true);
    $transparent = imagecolorallocatealpha($newimage, 255, 255, 255, 127);
    imagefilledrectangle($newimage, 0, 0, $dst_w, $dst_h, $transparent);
    imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);

Version tested: 1.4.1 WP version: 3.0

Markdown Textbox broken in v1.4.5 as downloaded from the Wordpress Plugin Directory

I was scratching my head for a bit on how to add a "Markdown Textbox" to a write panel – I simply could not find the option in the Magic-Fields interface.
However, there was an option labeled "textbox", so I gave that one a try – only to find out that the corresponding "textboxes" would not display in the write panel; only their labels, but no inputs at all.

I curiously did a search in the code, updated line 202 of MF_Constant.php to say "Markdown Textbox" (instead of "textbox") and things looked better in the write panel ;).

To make long things short – my request is to fix the Magic-Fields 1.4.5-download in the Wordpress Plugin Directory. Branch 1.4.5 here on github seems to be fine (the line in question says "Markdown Textbox").

Kudos for all your work hunk & Co.!
Btw., that preview video looks nice!

Tiny MCE dropping paragraphs

When going to edit a previously created page, the Tiny MCE box removes all paragraphs creating one large paragraph of text.

wrong dir during install

I tried to activate mf in my wpmu 2.9.2 setup and got the following errors
/wp-content/plugins/Magic-Fields/blogs.dir/1/files_mf/phpthumbcache/
/wp-content/plugins/Magic-Fields/blogs.dir/1/files_mf/

It should not have the path /plugins/Magic-Fields/ in there...
What file do I need to modify so that it will try to create the dirs in the proper location?
(by removing /plugins/Magic-Fields/ part then it's correct)

thnx

navigation menu needs work

hi
I hope this is the correct place to post this. i find that after i create a write panel (MyPanel), i then select "New" from the left hand menu under MyPanel. However, when i do this, the active menu item becomes "Post -> New". I think the highlighted menu item should be "MyPanel -> New".
Thanks for the great work!

Image field not working (2.9.2)

Getting this error on frontpage:

Fatal error: Call to undefined function: wp_load_image() in /homepages/.../htdocs/.../wp/wp-content/plugins/Magic-Fields/MF_thumb.php on line 23

I embedd the image inside the loop via:

while usingjust "get" seems to work and gives me the correct image url.

When uploading a image using the field i also don´t see the image thumb. Permission problem?

Specify options for TinyMCE Toolbars

Either through a per-field setting or universally with something like the TinyMCE Options Override plugin. (Sorry: thought this was the wish list. You can delete this.)

buggy javascript function "change_title_manage(write_panel)" in js/manage_page.js

Everyone using a non-english Wordpress probably have some problems on the title of the table. Simply Magic-Fields-code can't rely on strings content to make some split with jquery. For example::

tmp = jQuery(".wrap").children('h2').html().split('s ');

This can work only in English version of wordpress, with the word "Posts" in the title. For example, in Italian, the word is "Articoli" so tmp come up with an empty value.
And finally let me say that inject text via JS is not a good idea if you wanna mantain a multilingual plugin.

Use Media Library for Uploads

As an option, offer a field that taps into WordPress' existing media library instead of using its own upload function for selecting images. (Sorry: thought this was the wish list. You can delete this.)

multiline textbox remove paragraph tag?

Is there a way to remove the 'p' tage from automatically being inserted with multiline text field. The reason being that this conflicts with another plugin that inserts content twice for some reason when there is 'p' tag.

Javascript issues

Javascript does not work in panels created through Magic Fields.

It seems like some of the javascript scripts that should be included inside the new-post.php is not being added.

Wordpress 2.8.2., Magic Fields Version 1.3.1 to generate custom write panels.
Then I have WPML 1.7.1 and Akismet 2.2.7 in the live. No other plugins.

Incorrect blog directory detection in Network/Multisite mode

Using WordPress 3.0.1 Network and Magic Fields 1.4.5, MF uses root directory prefixes (WP_) instead of active blog's directory prefix (WP_1_, WP_2_, etc).

The problem seems to be in MF_Constant.php, code that calculates 'prefix all tables'.

The following does not work:

if(isset($current_blog)){
$mf_prefix=$wpdb->base_prefix;
}else{
$mf_prefix=$wpdb->prefix;
}

The following seem to:

$mf_prefix = $wpdb->get_blog_prefix();

(This issue was first discussed on the mailing list against v1.4)

v1.4 beta2 write panel issues / WP2.9.2

I have imported a write panel from flutter. It shows better in MF since all parameters are now taken into account.

However I have a group with many fields and the panel gets broken after a while, i.e. the frame ends abruptly and the last fields just appear in disorder at the bottom of the panel. I would upload a printscreen if I find how...

WP 3.0 Image Field not Duplicating

Like a few others around here I'm having an issue with the duplication of and Image field. I'm running WP 3.0 and using the newest build off of git as i needed the fix that was done to add old posts to Magic Fields.

Here are my output errors. I have checked the field names and no "-" are present. So I'm at a bit of a loss. Any help would be greatly appreciated.

Google Chrome Console Output
load-scripts.php:18 TypeError: Result of expression 'c.ui' [undefined] is not an object.
validate.js:4 TypeError: Result of expression 'jQuery("#post").validate' [undefined] is not a function.
wp-admin.css Failed to load resource: the server responded with a status of 404 (Not Found)

Firebug Console Output
c.ui is undefined
http://www.cindygannon.com/wp-admin/load-scripts.php?c=1&load=hoverIntent,common,jquery-color,schedule,wp-ajax-response,autosave,wp-lists,jquery-ui-resizable,admin-comments,suggest,jquery-ui-sortable,postbox,post,word-count,thickbox,media-upload&ver=1ff30763d6767a3ae812be332b82d2c3
Line 55

jQuery("#post").validate is not a function
http://www.cindygannon.com/wp-content/plugins/magic-fields/js/custom_fields/validate.js?ver=3.0
Line 4

Bug in function MultilineTextboxInterface.

For some time I had lot of bugs in magicfields generated post edition forms.

I found the bug in function MultilineTextboxInterface, it broked the layout on my setup.

A div was closed but never opened, see bellow the line that needs to be removed...

Solved it for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.