Add url of copyright to credits tag in package-info.xml

Started by davidhs, December 19, 2017, 01:18:02 PM

Previous topic - Next topic

davidhs

With SMF 2.1 Beta 1 was added credits tag :)

<credits url="..." license="..." copyright="..." title="..." />

And this was shown in credits page:

<a href="URL">TITLE OR MODNAME: MODVERSION</a> | LICENSE | COPYRIGHT


With SMF 2.1 Beta 3 was added url of license :D

<credits url="..." license="..." licenseurl="..." copyright="..." title="..." />

And this was shown in credits page:

<a href="URL">TITLE OR MODNAME: MODVERSION</a> | <a href="LICENSEURL">LICENSE</a> | COPYRIGHT


And now... can be added url of copyright?

<credits url="..." license="..." licenseurl="..." copyright="..." copyrighturl="..." title="..." />

And this will be shown in credits page:

<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

<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

{"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!

Suki

Yep, forgot about the length bit.  Tracked. Thanks :)
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

albertlast

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).

davidhs

Quote from: albertlast 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).
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?

Suki

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.

davidhs

I write here instead of in new topic because the main request of this topic is unsolved still. :(

Quote from: Suki on December 19, 2017, 04:35:48 PM
[...] 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]

vbgamer45

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

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

davidhs

Quote from: vbgamer45 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.
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

...<a href="..." class="bbc_link" target="_blank" rel="noopener">...</a>...

instead of equal to other links of credits

...<a href="...">...</a>...

and all links on the credits page should have same style.




Quote from: Suki on April 05, 2019, 12:28:50 PM
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

<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.

Kindred

I believe that may have purposefully been disallowed...

you get to specify the license URL and a URL for the mod...     
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Suki

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.

Sesquipedalian

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.

Advertisement: