Advertisement:

Author Topic: Add url of copyright to credits tag in package-info.xml  (Read 596275 times)

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,055
  • Gender: Male
Add url of copyright to credits tag in package-info.xml
« on: December 19, 2017, 01:18:02 PM »
With SMF 2.1 Beta 1 was added credits tag :)
Code: [Select]
<credits url="..." license="..." copyright="..." title="..." />
And this was shown in credits page:
Code: [Select]
<a href="URL">TITLE OR MODNAME: MODVERSION</a> | LICENSE | COPYRIGHT

With SMF 2.1 Beta 3 was added url of license :D
Code: [Select]
<credits url="..." license="..." licenseurl="..." copyright="..." title="..." />
And this was shown in credits page:
Code: [Select]
<a href="URL">TITLE OR MODNAME: MODVERSION</a> | <a href="LICENSEURL">LICENSE</a> | COPYRIGHT

And now... can be added url of copyright?
Code: [Select]
<credits url="..." license="..." licenseurl="..." copyright="..." copyrighturl="..." title="..." />
And this will be shown in credits page:
Code: [Select]
<a href="URL">TITLE OR MODNAME: MODVERSION</a> | <a href="LICENSEURL">LICENSE</a> | <a href="COPYRIGHTURL">COPYRIGHT</a>

For example, I could add url to my mods https://custom.simplemachines.org/mods/index.php?action=search;author=242014 or another personal webpage.

This require to increase size of the field credits of table smf_log_packages in database (now is varchar(255)).
If my credits in package-info.xml is
Code: [Select]
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2507" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2017, davidhs" />
the content of field credits of table smf_log_packages is
Code: [Select]
{"url":"https:\/\/custom.simplemachines.org\/mods\/index.php?mod=2507","license":"Creative Commons Attribution 3.0 Unported License","licenseurl":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/","copyright":"2010-2017, davidhs","title":""}
243 characters! And I do not use title... and my nick is small!

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,569
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Add url of copyright to credits tag in package-info.xml
« Reply #1 on: December 19, 2017, 01:25:32 PM »
Yep, forgot about the length bit.  Tracked. Thanks :)
« Last Edit: December 19, 2017, 01:59:40 PM by Suki »
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 591
Re: Add url of copyright to credits tag in package-info.xml
« Reply #2 on: December 19, 2017, 02:33:49 PM »
Changed the credit field from varchar to text,
please had in mind that you had to change this field manuel on your side(no update process availeble).

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,055
  • Gender: Male
Re: Add url of copyright to credits tag in package-info.xml
« Reply #3 on: December 19, 2017, 03:06:53 PM »
Changed the credit field from varchar to text,
please had in mind that you had to change this field manuel on your side(no update process availeble).
Thanks! I do not use SMF 2.1 Beta in my forum (and I am not a beta tester), I only add support to 2.1 Beta in my own mods. ;)

And about url of copyright?

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,569
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Add url of copyright to credits tag in package-info.xml
« Reply #4 on: December 19, 2017, 04:35:48 PM »
The license has a separate url type because I wanted to have a list of commonly used licenses, kinda like github has it, fetch them if no license url were provided and the license matches one in the list. Never got to do that, sadly.

That and because having a single "fit it all" copyright type offers mod authors some more freedom.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,055
  • Gender: Male
Re: Add url of copyright to credits tag in package-info.xml
« Reply #5 on: April 05, 2019, 07:46:55 AM »
I write here instead of in new topic because the main request of this topic is unsolved still. :(

[...] having a single "fit it all" copyright type offers mod authors some more freedom.
Ok, I am agree with this. Now SMF 2.1 RC1 and RC2 allows a longer text in copyright of credits but I can not add an url because copyright attribute of credits tag does not allow HTML/BBC tags. ??? Or maybe I do something wrong?

For example:
- I want add this credit:
Quote from: Credits page
Enhancements to purge inactive members: Versión 1.3.8 | License: Creative Commons Attribution 3.0 Unported License | Copyrights © 2010-2019, davidhs

- With only text (with no url :(, like SMF 2.1 Beta 2), works:
Code: (package-info.xml) [Select]
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, davidhs" />
Code: (Database (smf_log_packages.credits)) [Select]
{"url":"https:\/\/custom.simplemachines.org\/mods\/index.php?mod=2569","license":"Creative Commons Attribution 3.0 Unported License","licenseurl":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/","copyright":"2010-2019, davidhs","title":""}
Quote from: Credits page
Enhancements to purge inactive members: Versión 1.3.8 | License: Creative Commons Attribution 3.0 Unported License | Copyrights © 2010-2019, davidhs

- With HTML does not work (show nothing):
Code: (package-info.xml) [Select]
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, <a href=https://custom.simplemachines.org/mods/index.php?action=search;author=242014>davidhs</a>" />
or
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, <a href='https://custom.simplemachines.org/mods/index.php?action=search;author=242014'>davidhs</a>" />
or
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, <a href=&quot;https://custom.simplemachines.org/mods/index.php?action=search;author=242014&quot;>davidhs</a>" />
Code: (Database (smf_log_packages.credits)) [Select]
{"url":"","license":"","licenseurl":"","copyright":"","title":""}
Quote from: Credits page
Enhancements to purge inactive members: Versión 1.3.8

- With all HTML entities does not work (show entities):
Code: (package-info.xml) [Select]
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, &lt;a href=&quot;https://custom.simplemachines.org/mods/index.php?action=search;author=242014&quot;&gt;davidhs&lt;/a&gt;" />
Code: (Database (smf_log_packages.credits)) [Select]
{"url":"https:\/\/custom.simplemachines.org\/mods\/index.php?mod=2569","license":"Creative Commons Attribution 3.0 Unported License","licenseurl":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/","copyright":"2010-2019, &lt;a href=&quot;https:\/\/custom.simplemachines.org\/mods\/index.php?action=search;author=242014&quot;&gt;davidhs&lt;\/a&gt;","title":""}
Quote from: Credits page
Enhancements to purge inactive members: Versión 1.3.8 | License: Creative Commons Attribution 3.0 Unported License | Copyrights © 2010-2019, &lt;a href=&quot;https://custom.simplemachines.org/mods/index.php?action=search;author=242014&quot;&gt;davidhs&lt;/a&gt;

- With BBC does not work (show BBC without parse):
Code: (package-info.xml) [Select]
<credits url="https://custom.simplemachines.org/mods/index.php?mod=2569" license="Creative Commons Attribution 3.0 Unported License" licenseurl="https://creativecommons.org/licenses/by/3.0/" copyright="2010-2019, [url=https://custom.simplemachines.org/mods/index.php?action=search;author=242014]davidhs[/url]" />
Code: (Database (smf_log_packages.credits)) [Select]
{"url":"https:\/\/custom.simplemachines.org\/mods\/index.php?mod=2569","license":"Creative Commons Attribution 3.0 Unported License","licenseurl":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/","copyright":"2010-2019, [url=https:\/\/custom.simplemachines.org\/mods\/index.php?action=search;author=242014]davidhs[\/url]","title":""}
Quote from: Credits page
Enhancements to purge inactive members: Versión 1.3.8 | License: Creative Commons Attribution 3.0 Unported License | Copyrights © 2010-2019, [url=https://custom.simplemachines.org/mods/index.php?action=search;author=242014]davidhs[/url]

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,680
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Add url of copyright to credits tag in package-info.xml
« Reply #6 on: April 05, 2019, 11:47:03 AM »
Hmm I would think at least bbc should work.
If you think it is an issue I would file a github bug report.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,569
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,055
  • Gender: Male
Re: Add url of copyright to credits tag in package-info.xml
« Reply #8 on: April 05, 2019, 01:06:12 PM »
Hmm I would think at least bbc should work.
If you think it is an issue I would file a github bug report.
Yes, please. I tested several times (in RC1 and RC2) with the previous examples and it does not work.

Solution can be modify Source/Who.php file:
Code: (Search (line 854)) [Select]
<php?

$copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . $smcFunc['htmlspecialchars']($credit_info['copyright']);

?>
Code: (Replace by) [Select]
<php?

$copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . parse_bbc($smcFunc['htmlspecialchars']($credit_info['copyright']));

?>

But link of copyright is written as
Code: [Select]
...<a href="..." class="bbc_link" target="_blank" rel="noopener">...</a>...
instead of equal to other links of credits
Code: [Select]
...<a href="...">...</a>...
and all links on the credits page should have same style.



https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Packages.php#L1018

Those are the tags you can use inside the credits node, heres an example:  https://github.com/MissAllSunday/OharaYouTubeEmbed/blob/master/package-info.xml#L22
Ok, the syntax of credits tag is
Code: [Select]
<credits url="MOD_URL" license="LICENSE_TEXT" copyright="COPYRIGHT_TEXT" licenseurl="LICENSE_URL">TITLE</credits>
I know default TITLE is the mod name, but I did not know could write other TITLE between open-close tags. :)

But I want add url (with BBC or HTML) to COPYRIGHT_TEXT.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,632
  • Gender: Male
    • Kindred-999 on GitHub
Re: Add url of copyright to credits tag in package-info.xml
« Reply #9 on: April 05, 2019, 01:53:30 PM »
I believe that may have purposefully been disallowed...

you get to specify the license URL and a URL for the mod...     
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,569
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Add url of copyright to credits tag in package-info.xml
« Reply #10 on: April 05, 2019, 06:10:28 PM »
Yes, it was completely deliberated,  the credits node only allows two urls, one for the mod and another one for the license, this is to prevent link abuse.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Sesquipedalian

  • The Mad Doctor
  • On Hiatus
  • Sr. Member
  • *
  • Posts: 979
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Add url of copyright to credits tag in package-info.xml
« Reply #11 on: April 06, 2019, 09:34:52 AM »
It may be worth noting that mods can also add copyright info using the integrate_credits hook, which allows more freedom to the mod author.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.