Skip to content

Commit 2ea7f5c

Browse files
committed
Custom URL shortener admin Pro feature.
1 parent 5f3e30f commit 2ea7f5c

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/includes/menu-pages/gen-ops.inc.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,23 +1509,25 @@ public function __construct()
15091509
echo '</td>'."\n";
15101510

15111511
echo '</tr>'."\n";
1512-
echo '<tr>'."\n";
1512+
if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
1513+
echo '<tr>'."\n";
15131514

1514-
echo '<th>'."\n";
1515-
echo '<label for="ws-plugin--s2member-default-custom-str-url-shortener">'."\n";
1516-
echo 'Custom URL Shortening Service API (Optional/Advanced):'."\n";
1517-
echo '</label>'."\n";
1518-
echo '</th>'."\n";
1515+
echo '<th>'."\n";
1516+
echo '<label for="ws-plugin--s2member-default-custom-str-url-shortener">'."\n";
1517+
echo 'Custom URL Shortening Service API (Optional/Advanced):'."\n";
1518+
echo '</label>'."\n";
1519+
echo '</th>'."\n";
15191520

1520-
echo '</tr>'."\n";
1521-
echo '<tr>'."\n";
1521+
echo '</tr>'."\n";
1522+
echo '<tr>'."\n";
15221523

1523-
echo '<td>'."\n";
1524-
echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_default_custom_str_url_shortener" id="ws-plugin--s2member-default-custom-str-url-shortener" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["default_custom_str_url_shortener"]).'" /><br />'."\n";
1525-
echo 'Your own custom URL <code>(i.e., GET request)</code>, with <code>%%s2_long_url%%</code> Replacement Code. [<a href="#" onclick="alert(\'Advanced site owners can use a custom URL shortening service they prefer.\\n\\nIn order for this to work, your URL shortening service must support simple GET requests through its API (sometimes referred to as a REST or NVP API).\\n\\nIn addition, your URL shortening service must return a plain-text URL in the response. See example below.\\n\\nYOURLS example GET request with format=simple:\\n\\nhttp://yoursite.com/yourls/yourls-api.php?signature=1234567890&action=shorturl&format=simple&url=%%s2_long_url%%\\n\\ns2Member expects a shortened URL in the response from YOURLS.\\n\\nIf you configure s2Member to use your own custom URL shortening service, s2Member will try your configuration first, and if anything fails, it will fall back on its own pre-integrated backups.\\n\\nWhen configuring your URL for the GET request, s2Member makes two Replacement Codes available:\\n\\n%%s2_long_url%% = The full URL that needs to be shortened (raw URL-encoded).\\n\\n%%s2_long_url_md5%% = An MD5 hash of the full URL (might be useful in some APIs).\'); return false;" tabindex="-1">details</a>]<br />'."\n";
1526-
echo '</td>'."\n";
1524+
echo '<td>'."\n";
1525+
echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_default_custom_str_url_shortener" id="ws-plugin--s2member-default-custom-str-url-shortener" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["default_custom_str_url_shortener"]).'" /><br />'."\n";
1526+
echo 'Your own custom URL <code>(i.e., GET request)</code>, with <code>%%s2_long_url%%</code> Replacement Code. [<a href="#" onclick="alert(\'Advanced site owners can use a custom URL shortening service they prefer.\\n\\nIn order for this to work, your URL shortening service must support simple GET requests through its API (sometimes referred to as a REST or NVP API).\\n\\nIn addition, your URL shortening service must return a plain-text URL in the response. See example below.\\n\\nYOURLS example GET request with format=simple:\\n\\nhttp://yoursite.com/yourls/yourls-api.php?signature=1234567890&action=shorturl&format=simple&url=%%s2_long_url%%\\n\\ns2Member expects a shortened URL in the response from YOURLS.\\n\\nIf you configure s2Member to use your own custom URL shortening service, s2Member will try your configuration first, and if anything fails, it will fall back on its own pre-integrated backups.\\n\\nWhen configuring your URL for the GET request, s2Member makes two Replacement Codes available:\\n\\n%%s2_long_url%% = The full URL that needs to be shortened (raw URL-encoded).\\n\\n%%s2_long_url_md5%% = An MD5 hash of the full URL (might be useful in some APIs).\'); return false;" tabindex="-1">details</a>]<br />'."\n";
1527+
echo '</td>'."\n";
15271528

1528-
echo '</tr>'."\n";
1529+
echo '</tr>'."\n";
1530+
}
15291531
echo '</tbody>'."\n";
15301532
echo '</table>'."\n";
15311533
echo '</div>'."\n";

0 commit comments

Comments
 (0)