Advertisement:

Author Topic: Additional Authors  (Read 11415 times)

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Additional Authors
« on: August 09, 2014, 07:36:48 PM »
Link to Mod

Additional Authors
If you need to report a bug, please do so on GitHub!

Ever wanted to collaborate on a first post with less privileged users? Didn't feel like giving them more permissions? Then this is the mod for you!
Additional Authors allows you to add any registered user to a first post. He/she can edit it like any other post.
Additionally, the mod displays a nice overview of mini-profiles of everyone involved in the post.

Features
- Additional mini-profiles on first post
- Easy to use interface
- Integration with the Display Additional Membergroups mod by margarett
* (if this feature is not available, the mod will still work correctly)
- Allow co-authors to edit the post

Changelog
v0.1
- Initial release

Planned features
- Switch for first/any post (currently only first post)

License:
This mod is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported license.

Permissions added
Yes, and disabled by default.

Files modified
- Sources/Display.php
- Sources/ManagePermissions.php
- Sources/Subs-Post.php
- Sources/Post.php
- Themes/default/Display.template.php
- Themes/default/Post.template.php
- Themes/default/css/index.css
- Themes/default/languages/Modifications.{language}.php

Tables added/modified
- {db_prefix}topics
* Column add_authors (text) will be added.

Languages available
- English
Translations are welcome!
« Last Edit: December 11, 2014, 10:37:47 AM by NanoSector »
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: Additional Authors
« Reply #1 on: August 09, 2014, 07:47:46 PM »
Nice Modification!! :)

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #2 on: August 10, 2014, 04:06:57 AM »
Thank you :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: Additional Authors
« Reply #3 on: August 10, 2014, 05:13:42 AM »
Anytime. :)

Offline Skaty

  • Jr. Member
  • **
  • Posts: 357
Re: Additional Authors
« Reply #4 on: August 11, 2014, 06:54:54 AM »
Nice mod. I have installed with no errors. When i tried to open a new topic it is given me this error:


Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #5 on: August 11, 2014, 07:34:14 AM »
Can you attach your Post.php file in your next post please?
ETA: Nevermind, found the bug. Will push a new package out in a few minutes, please uninstall the mod in the meantime :)

ETA2: Sorry for the delay, my home server was/is making weird noises so I had to create a backup. New package is attached to the mod page.
« Last Edit: August 11, 2014, 08:43:53 AM by NanoSector »
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Additional Authors
« Reply #6 on: August 21, 2014, 01:12:20 AM »
This is really neat! Does it work with avatars? What about member colour link? :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #7 on: August 21, 2014, 04:13:48 AM »
Thanks Jade :)

Yes it works with avatars. Might make it work with member colours in the paid version, if that's a mod.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Additional Authors
« Reply #8 on: August 21, 2014, 05:41:20 AM »
Sweet, I am considering using it and molesting my display template. I think it would work exceptionally well on my forum :D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Additional Authors
« Reply #9 on: August 26, 2014, 08:46:10 PM »
Nice MOD NanoSector!
I would like to install it as well but it fails here in sources/post.php
Code: (find) [Select]
t.id_first_msg, mf.subject,
Code: (add after) [Select]
t.add_authors,
and also here in Themes/default/post.template.php

Code: (find) [Select]
', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
</ul>
</div>';

Code: (replace) [Select]
', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
', $context['can_add_authors'] ? '<li><label for="addAuthors">Additional authors: <input type="text" name="addAuthors" id="addAuthors" class="input_text"></input></label><div id="author_container"></div></li>' : '', '
</ul>
</div>';

// Additional authors mod - JavaScript
if ($context['can_add_authors'])
{
echo '<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // -->
var oAuthorSuggest = new smc_AutoSuggest({
sSelf: \'oAuthorSuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'addAuthors\',
sControlId: \'addAuthors\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'add_authors\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'author_container\',
aListItems: [';

if (!empty($context['add_authors']))
foreach ($context['add_authors'] as $id_member => $member_name)
echo '
{
sItemId: ', JavaScriptEscape($id_member), ',
sItemName: ', JavaScriptEscape($member_name), '
}', $id_member == $context['add_authors'] ? '' : ',';

echo '
]
});
// ]]></script>';
}

I can't figure out how to fix those errors and it's probably due to the other 90+ mods installed, can you help me if you have some time? :)
*attached both faulty files*
Thanks in advance anyway!
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline ryan_dwight

  • Jr. Member
  • **
  • Posts: 296
Re: Additional Authors
« Reply #10 on: August 28, 2014, 10:39:17 AM »
Thank you for this great mod.

I installed on my forum with blacknblack theme. I managed to edit the display template and it was successfully appeard on the post but how can I change the color or the background fo the additional author? It is a white box same as the default theme but I am using a black theme. Is it possible to make it same as my theme?

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #11 on: August 28, 2014, 10:44:49 AM »
Sure, what colour would you like it to be?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #12 on: August 28, 2014, 10:49:57 AM »
Nice MOD NanoSector!
I would like to install it as well but it fails here in sources/post.php
Code: (find) [Select]
t.id_first_msg, mf.subject,
Code: (add after) [Select]
t.add_authors,
and also here in Themes/default/post.template.php

Code: (find) [Select]
', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
</ul>
</div>';

Code: (replace) [Select]
', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', '
', $context['can_add_authors'] ? '<li><label for="addAuthors">Additional authors: <input type="text" name="addAuthors" id="addAuthors" class="input_text"></input></label><div id="author_container"></div></li>' : '', '
</ul>
</div>';

// Additional authors mod - JavaScript
if ($context['can_add_authors'])
{
echo '<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // -->
var oAuthorSuggest = new smc_AutoSuggest({
sSelf: \'oAuthorSuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'addAuthors\',
sControlId: \'addAuthors\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'add_authors\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'author_container\',
aListItems: [';

if (!empty($context['add_authors']))
foreach ($context['add_authors'] as $id_member => $member_name)
echo '
{
sItemId: ', JavaScriptEscape($id_member), ',
sItemName: ', JavaScriptEscape($member_name), '
}', $id_member == $context['add_authors'] ? '' : ',';

echo '
]
});
// ]]></script>';
}

I can't figure out how to fix those errors and it's probably due to the other 90+ mods installed, can you help me if you have some time? :)
*attached both faulty files*
Thanks in advance anyway!
Try the attached files. It was indeed a mod conflict.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline ryan_dwight

  • Jr. Member
  • **
  • Posts: 296
Re: Additional Authors
« Reply #13 on: August 28, 2014, 10:59:47 AM »
Sure, what colour would you like it to be?

I am using this theme
http://custom.simplemachines.org/themes/index.php?lemma=126

I think black BG ang blue font.

Thanks

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Additional Authors
« Reply #14 on: August 28, 2014, 11:37:23 AM »
Try the attached files. It was indeed a mod conflict.
Awesome dude, it was a bit too complicated for me to solve it, it seems to be working perfectly now :D thanks a lot! I will tell you if something appears in the error log ;) thanks again!
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Additional Authors
« Reply #15 on: September 23, 2014, 01:27:56 PM »
Got another problem while using "Delete spam post" mod, I don't know if it is a conflict between the 2 but I got this:
Quote
index.php?action=deletespampost;topic=86.1;msg=147
Undefined index: add_authorsApply Filter:
File: /Sources/Subs-Post.php
Line: 2563
Any clues? >_< thanks in advance, sorry for being criptic, gotta go in a minute
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #16 on: September 23, 2014, 02:36:43 PM »
Seems to be an issue in both :)
Delete spam post doesn't fill in the add_authors key in $topicOptions causing this error because my mod doesn't check it the proper way. :)
I'll fix it tomorrow but it's not high priority.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Additional Authors
« Reply #17 on: September 23, 2014, 03:18:41 PM »
Yup, thanks again, no problem :D sorry for being so much annoying about it xD
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Additional Authors
« Reply #18 on: September 23, 2014, 03:54:13 PM »
To probably fix it yourself in the meantime, change:
Code: [Select]
|| $topicOptions['add_authors'] !== null)to
Code: [Select]
|| !empty($topicOptions['add_authors']))in that file.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Additional Authors
« Reply #19 on: September 23, 2014, 04:14:36 PM »
Indeed it worked I just tested it :D thanks a lot for the ultra-fast fix!!!
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE