@@ -124,7 +124,7 @@ function tag_block_cloud_show(array $options, string $dirname = '', int $catid =
124124 $ criteria ->add (new \Criteria ('l.tag_catid ' , (string )$ catid ));
125125 }
126126 }
127- if (!$ tags_array = $ tagHandler ->getByLimit ($ options [0 ], Constants::BEGINNING , $ criteria , null , empty ($ options [1 ]))) {
127+ if (!$ tags_array = $ tagHandler ->getByLimit (( int ) $ options [0 ], Constants::BEGINNING , $ criteria , null , empty ($ options [1 ]))) {
128128 return $ block ;
129129 }
130130
@@ -281,7 +281,7 @@ function tag_block_top_show(array $options, string $dirname = '', int $catid = 0
281281 $ criteria ->add (new \Criteria ('l.tag_catid ' , (string )$ catid ));
282282 }
283283 }
284- if (!$ tags_array = $ tagHandler ->getByLimit (0 , 0 , $ criteria , null , false )) {
284+ if (!$ tags_array = $ tagHandler ->getByLimit (( int ) $ options [ 0 ], Constants:: BEGINNING , $ criteria , null , false )) {
285285 return $ block ;
286286 }
287287
@@ -326,28 +326,28 @@ function tag_block_top_show(array $options, string $dirname = '', int $catid = 0
326326
327327 //-------------------------------------------
328328
329- $ sql = 'SELECT o.tag_id, COUNT(o.tag_id) AS count_tag, l.tag_term
330- FROM ' . $ GLOBALS ['xoopsDB ' ]->prefix ('tag_link ' ) . ' AS o
331- LEFT JOIN ' . $ GLOBALS ['xoopsDB ' ]->prefix ('tag_tag ' ) . ' AS l ON l.tag_id = o.tag_id
332- GROUP BY o.tag_id
333- ORDER BY count_tag DESC ' ;
334- $ result = $ GLOBALS ['xoopsDB ' ]->query ($ sql );
335- if ($ result instanceof \mysqli_result) {
336- $ tags_array2 = [];
337- $ tags_data_array = [];
338- while (false !== ($ myrow = $ GLOBALS ['xoopsDB ' ]->fetchArray ($ result ))) {
339- $ tags_array2 [] = $ myrow ;
340- }
341- foreach ($ tags_array2 as $ tag ) {
342- $ tags_data_array [] = [
343- 'id ' => $ tag ['tag_id ' ],
344- 'term ' => $ tag ['tag_term ' ],
345- 'count ' => $ tag ['count_tag ' ],
346- ];
347- }
348- } else {
349- \trigger_error ($ GLOBALS ['xoopsDB ' ]->error ());
350- }
329+ // $sql = 'SELECT o.tag_id, COUNT(o.tag_id) AS count_tag, l.tag_term
330+ // FROM ' . $GLOBALS['xoopsDB']->prefix('tag_link') . ' AS o
331+ // LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('tag_tag') . ' AS l ON l.tag_id = o.tag_id
332+ // GROUP BY o.tag_id
333+ // ORDER BY count_tag DESC' . ' LIMIT ' . $options[0] ;
334+ // $result = $GLOBALS['xoopsDB']->query($sql);
335+ // if ($result instanceof \mysqli_result) {
336+ // $tags_array2 = [];
337+ // $tags_data_array2 = [];
338+ // while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
339+ // $tags_array2[] = $myrow;
340+ // }
341+ // foreach ($tags_array2 as $tag) {
342+ // $tags_data_array2 [] = [
343+ // 'id' => $tag['tag_id'],
344+ // 'term' => $tag['tag_term'],
345+ // 'count' => $tag['count_tag'],
346+ // ];
347+ // }
348+ // } else {
349+ // \trigger_error($GLOBALS['xoopsDB']->error());
350+ // }
351351
352352 //-------------------------------------------
353353
0 commit comments