Phundament 3 - Media ¶
p3media 0.1.0
Requirements ¶
- Yii 1.1.8
- PHP 5.3
Download ¶
Via github.
Installation ¶
Note: You can also place the module and extensions from the download package into your app, run the migration, create the directory and adjust the config manually.
If YII_DEBUG is set to true, user->checkAccess() is disabled.
If you prefer to test this module with a blank Yii web application skeletion follow these steps:
Extract & create webapp ¶
tar -xzf p3media-<SHA1>.tar.gz p3media-demo
For the demo, we'll setup an app skeleton ~~~ cd p3media-demo /path/to/yiic webapp . ~~~
Database Migration ¶
Run migration to setup database schema ~~~ protected/yiic migrate \ --migrationPath=application.modules.p3media.migrations \ --migrationTable=migration_module_p3media ~~~
Directory permissions ¶
P3Media will store its files here: ~~~ mkdir protected/data/p3media chmod 777 protected/data/p3media/ ~~~
If you want to import local files (e.g. FTP uploads) your should also create the import directory
mkdir protected/data/p3media-import
chmod 777 protected/data/p3media-import/
Configuration ¶
Include the configuration file provided along with p3media.
return CMap::mergeArray(
require(dirname(__FILE__).'/../modules/p3media/config/main.php'),
...
Usage ¶
Go to the index page of the module
~~~
http://localhost/webapp/index.php?r=p3media
~~~
Upload files ¶
Upload your files by selecting 'Add files...' or by drag & drop
~~~
http://localhost/webapp/index.php?r=p3media/import/upload
~~~
Ckeditor Test ¶
Open the ckeditor test page and click on the image icon and then 'Browse server'. Select an image and confirm, the image should be added in your editor. ~~~ http://localhost/webapp/index.php?r=p3media/default/ckeditortest ~~~
API ¶
Under construction
You can retrieve a resized version (see presets in config) of an image by using the 'ID' and the 'PRESET' as URL params
~~~
/index.php?r=p3media/file/image&id={ID}&preset={PRESET}
~~~
Features ¶
- Ckfinder replacement for integration with ckeditor
- Multi-file upload with jquery-file-upload
- Media presets for easy usage of image
- CRUDs build with gtc
- Meta-data enabled (hierarchy, permissions)
Developer Checkout ¶
git clone --recursive git://github.com/schmunk42/p3media.git \
protected/modules/p3media
git clone --recursive git://github.com/schmunk42/p3extensions.git \
protected/extensions/p3extensions
git clone --recursive https://github.com/schmunk42/gii-template-collection \
protected/extensions/gtc
Resources ¶
- Project page on github
- Core module of Phundament 3
Good
Excellent job ! Working great with phundament3.
More explanations on how to use media_meta_data (hierarchy, permissions, status and so on) could be usefull.
cannot migrate
Hi!
This module seems to be promising. Unfortunately I cannot migrate this in Yii 1.1.10, or at least I am unable to create the database table. Can I find a simple sql file somewhere to build up the table manually?
Thanks!
Heiko
P3Media SQL
Hi Heiko,
please see my answer here.
Best regards,
schmunk
Error 500
I installed p3media and I get this error:
Error 500
Directory with alias 'application.data.p3media' not writable.
I check directory permissions and its writable. ( at least I think so it is)
Any help with this?
EDIT
I was wrong - I didn't install p3media as it should. Now its ok.
Any Screenshots ?
Just curious if you could post a screenshot or two?
Screenshots
@Jesse Just created some screenshots see here on Google
Installation via composer is recommended, please see also phundament/app
can p3media be inserted as a widget?
Hi there, I need to allow users to upload images in one of my listviews,
can p3Media do that via its api?
Does it have a widget?
@Fire: p3media upload widget
This is currently not available as a high-quality and customizable widget.
But as an idea, take a look at the browser view from p3media.
You'll find this line:
<p><?php $this->widget('jquery-file-upload-widget.EFileUpload'); ?></p>
But the code for this widget (from p3extensions) is - honestly - a hardcoded mess. But it also may do the job.
Together with the
eventBridge
behavior you are also able to set permissions for every record after its construction.PS: A PR for a more sophisticated upload-widget would be highly welcome ;)
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.