Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Greg Rice Posted September 6, 2017 Posted September 6, 2017 I've been working my way through the Plugin documentation, but it's not very comprehensive. Can someone offer some advice/tips about how to approach creating a Plugin that allows for Admin users to upload their custom icons into some sort of a library, and then for users to be able to assign one of the icons to a specific thread? As I understand it, I need to: Create Theme Hooks (front: forums): One for where the icon is chosen by the thread starter, and another for where the chosen icon will appear. Create a Setting to allow admin to upload new icons. Then create database columns to store the icon and topic IDs. Finally create a Code Hook to read and write all the above. Is that about right? It seems to me that creating a new table for the icon library might be in order, but it's not clear from the documentation how this might be done?
Adriano Faria Posted September 6, 2017 Posted September 6, 2017 1 minute ago, Greg Rice said: Create a Setting to allow admin to upload new icons. Then create database columns to store the icon and topic IDs. Best way to go is extend \IPS\forums\Forum::form() to add a new tab. Example: /** * [Node] Add/Edit Form * * @param \IPS\Helpers\Form $form The form * @return void */ public function form( &$form ) { $data = parent::form( $form ); $form->addTab( 'icon_lang_bit' ); $form->add( new \IPS\Helpers\Form\Upload( ..... ); return $data; } /** * [Node] Format form values from add/edit form for save * * @param array $values Values from the form * @return array */ public function formatFormValues( $values ) { //process the field, if necessary. return parent::formatFormValues( $values ); } That would create a new tab, like:
Adriano Faria Posted September 6, 2017 Posted September 6, 2017 Btw, forum icon is already a feature since IPS 4.0.0.
newbie LAC Posted September 6, 2017 Posted September 6, 2017 15 minutes ago, Adriano Faria said: Btw, forum icon is already a feature since IPS 4.0.0. Topic starter wants topic icons
Adriano Faria Posted September 6, 2017 Posted September 6, 2017 1 hour ago, newbie LAC said: Topic starter wants topic icons Oh yes, it's in the end of first paragraph. Too long to read. Gone by the title.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.