Browse code

fix for link and level for admincreated users

Jimako authored on 2024/05/13 13:49:32
Showing 2 changed files
... ...
@@ -227,7 +227,7 @@ function format_email($text) {
227 227
 // Function to format a URL into a clickable link
228 228
 function format_link($text, $title = "", $target = 0) {
229 229
 	if(empty($title)) $title = $text;
230
-	if(strpos($text, "http://") === false) $text = "http://".$text;
230
+	if(strpos($text, "http://") === false && strpos($text, "https://")) $text = "https://".$text;
231 231
 	$text = "<a href='$text'".($target ? " target='_blank'" : "").">$title</a>";
232 232
 	return $text;
233 233
 }
... ...
@@ -37,7 +37,7 @@ if(!empty($favorites) && isMEMBER && $userinfo['uid'] != USERUID) {
37 37
 }
38 38
  
39 39
 $tpl->assign("userpenname", $userinfo['penname']." ".$nameinfo);
40
-$tpl->assign("membersince", date("$dateformat", $userinfo['date']));
40
+
41 41
 if($userinfo['realname'])
42 42
 	$tpl->assign("realname", $userinfo['realname']);
43 43
 if($userinfo['bio']) {
... ...
@@ -46,7 +46,12 @@ if($userinfo['bio']) {
46 46
 }
47 47
 if($userinfo['image'])
48 48
 	$tpl->assign("image", "<img src=\"".$userinfo['image']."\">");
49
-$tpl->assign("userlevel", isset($userinfo['level']) && $userinfo['level'] > 0 && $userinfo['level'] < 4 ? _ADMINISTRATOR.(isADMIN ? " - ".$userinfo['level'] : "") : _MEMBER);
49
+
50
+/* don't display member if it was added by admin - release them rather */
51
+if(isset($userinfo['admicreated']) && $userinfo['admicreated'] == 0) {
52
+	$tpl->assign("membersince", date("$dateformat", $userinfo['date']));
53
+	$tpl->assign("userlevel", isset($userinfo['level']) && $userinfo['level'] > 0 && $userinfo['level'] < 4 ? _ADMINISTRATOR.(isADMIN ? " - ".$userinfo['level'] : "") : _MEMBER);
54
+}
50 55
 /* Dynamic authorinfo fields */
51 56
 $result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
52 57
 $dynamicfields = "";
... ...
@@ -88,4 +93,4 @@ if(isADMIN && uLEVEL < 3) {
88 93
 	$tpl->assign("adminoptions", $adminopts);
89 94
 }
90 95
 $tpl->gotoBlock("_ROOT");
91
-?>
92 96
\ No newline at end of file
97
+?>