Browse code

#3 Default value for title in stats block

Jimako authored on 2024/04/25 05:41:05
Showing 1 changed files
... ...
@@ -25,6 +25,9 @@
25 25
 if(!defined("_CHARSET")) exit( );
26 26
 
27 27
 list($field_id, $field_title) = dbrow(dbquery("SELECT field_id, field_title FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_name = 'betareader'"));
28
+ 
29
+if(empty($field_title)) $field_title = _BETAS;
30
+
28 31
 $query = dbquery("SELECT count(uid) FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field = '$field_id' AND info = '"._YES."'");
29 32
 list($count) = dbrow($query);
30 33
 if(!empty($blocks['info']['style']) && $blocks['info']['style'] == 2) {
... ...
@@ -34,4 +37,3 @@ else if(!empty($blocks['info']['style']) && $blocks["info"]["style"] == 1) {
34 37
 	$content = preg_replace("@\{totalbetas\}@", $count, $content);
35 38
 }
36 39
 else $content .= "<div><span class='label'>".$field_title.": </span>".$count."</div>";
37
-?>
38 40
\ No newline at end of file