以下是重构后的代码:
```javascript
var iclick = 0;
var num_rows = 1;
var num_page = 0;
var page_size = 10;
var page_this = 1;
var def_img = ''';
var idx_img = 0;
var img_name_ary = new Array();
var img_poster_ary = new Array();
var img_date_ary = new Array();
var img_good_ary = new Array();
var img_txt_ary = new Array();
img_name_ary[1] = '2019/0000098005.JPG';
img_poster_ary[1] = 'ますみ 提供';
img_date_ary[1] = '2019-09-11 ';
img_good_ary[1] = '47人說讚 讚一個';
```
以下是根据您提供的内容进行重构的代码段,其中包括修改后的函数show、img_txt_ary变量的初始化和img_name_ary变量的更新。
```javascript
img_txt_ary[1] = "";
function show(idex) {
if (idex === 0) return;
is_alert = false;
idx_img = idex;
document.cmm_img_show.src = "/photo_box_po/cmm_img/" + img_name_ary[idex];
nxt_idx = idex + 1;
nxt_page = page_this + 1;
if (nxt_idx <= num_rows) {
href_rs = "javascript:show(" + nxt_idx + ");";
} else if (nxt_page <= num_page) {
href_rs = "img_link.php?page=" + nxt_page + "&num=27875&gk=99";
} else if (num_rows > 0 && num_page > 1) {
is_alert = true;
href_rs = "img_link.php?page=1&num=27875&gk=99";
} else if (num_rows > 1) {
is_alert = true;
href_rs = "javascript:show(1);";
} else {
href_rs = "javascript:show(1);";
}
if (is_alert && iclick > 0) {
alert("最后一张图片,下一张将回到第一张");
}
iclick++;
document.getElementById('cmm_img_show_href').href = href_rs;
document.getElementById('cmm_img_info').innerHTML = img_poster_ary[idex];
}
```
请注意,以上代码仅为重构后的结果,并未考虑上下文环境和完整的代码结构。在实际使用时,您可能需要根据具体情况进行进一步调整和完善。
将以下内容重构为一个代码块,并保持段落结构:
```javascript
document.getElementById('cmm_img_info').innerHTML += img_date_ary[idex];
document.getElementById('cmm_img_info').innerHTML += img_good_ary[idex];
if (img_txt_ary[idex] != '') {
document.getElementById('cmm_img_txt').innerHTML = img_txt_ary[idex] + '
';
} else {
document.getElementById('cmm_img_txt').innerHTML = '';
}
}
if (def_img != '') show(idx_img);
```