您好,欢迎访问一九零五行业门户网

为什么这个框架里面的选项切换后只显示4个

这个地方本来是一行(4个内容)
想让它显示8个内容,也就是两行,更改appsindexcontrollersindex.php里的
$recentitems = $itemsclass->getall(0, 4 `status` = 'active' , '`datetime` desc');


$recentitems = $itemsclass->getall(0, 8 `status` = 'active' , '`datetime` desc');

实现了如上图所显示的两行(8个内容)
但是,但是点击上面的任意按钮,又变成4个了
html代码如下:
最新上传的作品
{if $recentitems} 全部 {if $maincategories} {foreach from=$maincategories item=c} 婚礼相册 清新简约 企业宣传 生日祝寿 毕业纪念 片头logo 儿童卡通 唯美浪漫 写真mv 年会颁奖 震撼大气 节日庆典 动感时尚 白事葬礼 微信小视频 水墨中国风 字幕条 {/foreach} {/if}
更多
{foreach from=$recentitems item=i}
{foreach from=$i.categories item=e} {foreach from=$e item=c name=foo} {if $smarty.foreach.foo.last}{$categories[$c].name}{/if} {/foreach} {/foreach}
{$i.price} ¥
{$i.name|escape}
{if $users[$i.user_id].avatar != ''} {else} {/if}
{/foreach}
{literal} {/literal} {/if}

php代码如下:
getall(0, 0, $itemsclass->userswhere); abr('users', $users);#推荐作品 $weeklyitems = $itemsclass->getall(0, 4, `status` = 'active' and `weekly_to` >= '.date('y-m-d').' , `datetime` desc); abr('weeklyitems', $weeklyitems); if($itemsclass->foundrows > 10) { abr('haveweekly', 'yes'); }#加载分类 require_once root_path.'/apps/categories/models/categories.class.php'; $categoriesclass = new categories(); $categories = $categoriesclass->getall(); abr('categories', $categories); #近期作品 $recentitems = $itemsclass->getall(0, 8, `status` = 'active' , '`datetime` desc'); kshuffle($recentitems); abr('recentitems', $recentitems); //免费作品 $freeitem = $itemsclass->getall(0, 4, `status` = 'active' and `free_file` = 'true' , '`datetime` desc'); abr('freeitem', $freeitem); #推荐作者 require_once root_path.'/apps/users/models/users.class.php'; $usersclass = new users(); //获取用户信息及粉丝 $featuredauthor = $usersclass->getall(0, 0, `status` = 'activate' and `featured_author` = 'true' , 'rand()'); // if(is_array($featuredauthor)) { // //作者的一些作品 // $featureditems = array(); // foreach($featuredauthor as $itear){ // $featureditems[$itear['user_id']] = $itemsclass->getall(0, 2, `status` = 'active' and `user_id` = '.intval($itear['user_id']).' ); // } // abr('featureditems', $featureditems); // abr('featuredauthorinfo', langmessagereplace($langarray['featured_author_info'], array( // 'username' => $featuredauthor['username'], // 'month' => $langarray['montharr'][date('n', strtotime($featuredauthor['register_datetime']))], // 'year' => date('y', strtotime($featuredauthor['register_datetime'])), // 'items' => $featuredauthor['items'], // 'sales' => $featuredauthor['sales'] // ))); // } abr('featuredauthor', $featuredauthor);#推荐作者 require_once root_path.'/apps/users/models/users.class.php'; $usersclass = new users(); $newauthor = $usersclass->getall(0, 8, `status` = 'activate' , 'rand()'); abr('newauthor', $newauthor);#用户关注的作者的最新作品 if(check_login_bool()) { $following = $usersclass->getfollowersid($_session['user']['user_id']); if(is_array($following)) { $wherequery = ''; foreach($following as $f) { if($wherequery != '') { $wherequery .= ' or '; } $wherequery .= `user_id` = '.intval($f['follow_id']).' ; } $followingitems = $itemsclass->getall(0, 0, `status` = 'active' and ($wherequery) , `datetime` desc); abr('followingitems', $followingitems); abr('followingitemscount', $itemsclass->foundrows); abr('emptythumb', (10-$itemsclass->foundrows)); } }#王牌作者 $topauthors = $usersclass->getall(0, 9, `status` = 'activate' and `sales` > 0 , `sales` desc); abr('topauthors', $topauthors); abr('topauthorscount', $usersclass->foundrows); abr('emptythumb', (9-$usersclass->foundrows)); #随机分类 $randcategories = array_rand($maincategories, 5); abr('randcategories', $randcategories); #最低价格 $lowprice = $itemsclass->getall(0, 1, `status` = 'active' , `price` asc); if(is_array($lowprice)) { $lowprice = array_shift($lowprice); $lowprice = $lowprice['price']; } abr('lowprice', $lowprice); #快讯 require_once root_path.'/apps/qnews/models/qnews.class.php'; $qnews = new qnews(); $data = array(); foreach($qnews->getall(0, 1, `visible` = 'true') as $key => $value) { if($value['photo']) { $data[$key] = $value; $data[$key]['thumb'] = 'static/uploads/qnews/260x140/' . $value['photo']; } } abr('qnews_data', $data); #面包屑 abr('breadcrumb', ''.$langarray['home'].'');//读取所有tags require_once root_path. /apps/tags/models/tags.class.php;//引入tag的数据库模型类//读取所有tags $tags = new tags();//读取所有tags $gettags = $tags->getall();//获取数据模型,结果为一个数组//读取所有tags abr('tags_new',$gettags);//在smarty模板中加入变量‘tags_new’//读取所有tags {foreach from=$tags_new item=t}//读取所有tags {$t.name}//读取所有tags {/foreach} //开始。。//获取所有一级分类 require_once root_path . /apps/categories/models/categories.class.php; $categoriesclass = new categories(); $allcategories_0 = $categoriesclass->getall(0, 0, `visible` = 'true' and `sub_of`=0 ); $data = array(); foreach ($allcategories_0 as $categories_data) { //获取当前分类子分类 $categories_son = $categoriesclass->getall(0, 0, `visible` = 'true' and `sub_of`= .intval($categories_data['id']). ); //获取一级分类下得所有作品 $wherequery = and `id` in (select `item_id` from `items_to_category` where `categories` like '%,.intval($categories_data['id']).,%') ; $items = $itemsclass->getall(0, 0, `status` = 'active' .$wherequery); $data[$categories_data['id']][] = array( 'categories' => $categories_data, 'categories_son' => $categories_son, 'items' => $items ); } abr('data',$data); ?>

网站地址
回复内容:
这个地方本来是一行(4个内容)
想让它显示8个内容,也就是两行,更改appsindexcontrollersindex.php里的
$recentitems = $itemsclass->getall(0, 4 `status` = 'active' , '`datetime` desc');


$recentitems = $itemsclass->getall(0, 8 `status` = 'active' , '`datetime` desc');

实现了如上图所显示的两行(8个内容)
但是,但是点击上面的任意按钮,又变成4个了
html代码如下:
最新上传的作品
{if $recentitems} 全部 {if $maincategories} {foreach from=$maincategories item=c} 婚礼相册 清新简约 企业宣传 生日祝寿 毕业纪念 片头logo 儿童卡通 唯美浪漫 写真mv 年会颁奖 震撼大气 节日庆典 动感时尚 白事葬礼 微信小视频 水墨中国风 字幕条 {/foreach} {/if}
更多
{foreach from=$recentitems item=i}
{foreach from=$i.categories item=e} {foreach from=$e item=c name=foo} {if $smarty.foreach.foo.last}{$categories[$c].name}{/if} {/foreach} {/foreach}
{$i.price} ¥
{$i.name|escape}
{if $users[$i.user_id].avatar != ''} {else} {/if}
{/foreach}
{literal} {/literal} {/if}

php代码如下:
getall(0, 0, $itemsclass->userswhere); abr('users', $users);#推荐作品 $weeklyitems = $itemsclass->getall(0, 4, `status` = 'active' and `weekly_to` >= '.date('y-m-d').' , `datetime` desc); abr('weeklyitems', $weeklyitems); if($itemsclass->foundrows > 10) { abr('haveweekly', 'yes'); }#加载分类 require_once root_path.'/apps/categories/models/categories.class.php'; $categoriesclass = new categories(); $categories = $categoriesclass->getall(); abr('categories', $categories); #近期作品 $recentitems = $itemsclass->getall(0, 8, `status` = 'active' , '`datetime` desc'); kshuffle($recentitems); abr('recentitems', $recentitems); //免费作品 $freeitem = $itemsclass->getall(0, 4, `status` = 'active' and `free_file` = 'true' , '`datetime` desc'); abr('freeitem', $freeitem); #推荐作者 require_once root_path.'/apps/users/models/users.class.php'; $usersclass = new users(); //获取用户信息及粉丝 $featuredauthor = $usersclass->getall(0, 0, `status` = 'activate' and `featured_author` = 'true' , 'rand()'); // if(is_array($featuredauthor)) { // //作者的一些作品 // $featureditems = array(); // foreach($featuredauthor as $itear){ // $featureditems[$itear['user_id']] = $itemsclass->getall(0, 2, `status` = 'active' and `user_id` = '.intval($itear['user_id']).' ); // } // abr('featureditems', $featureditems); // abr('featuredauthorinfo', langmessagereplace($langarray['featured_author_info'], array( // 'username' => $featuredauthor['username'], // 'month' => $langarray['montharr'][date('n', strtotime($featuredauthor['register_datetime']))], // 'year' => date('y', strtotime($featuredauthor['register_datetime'])), // 'items' => $featuredauthor['items'], // 'sales' => $featuredauthor['sales'] // ))); // } abr('featuredauthor', $featuredauthor);#推荐作者 require_once root_path.'/apps/users/models/users.class.php'; $usersclass = new users(); $newauthor = $usersclass->getall(0, 8, `status` = 'activate' , 'rand()'); abr('newauthor', $newauthor);#用户关注的作者的最新作品 if(check_login_bool()) { $following = $usersclass->getfollowersid($_session['user']['user_id']); if(is_array($following)) { $wherequery = ''; foreach($following as $f) { if($wherequery != '') { $wherequery .= ' or '; } $wherequery .= `user_id` = '.intval($f['follow_id']).' ; } $followingitems = $itemsclass->getall(0, 0, `status` = 'active' and ($wherequery) , `datetime` desc); abr('followingitems', $followingitems); abr('followingitemscount', $itemsclass->foundrows); abr('emptythumb', (10-$itemsclass->foundrows)); } }#王牌作者 $topauthors = $usersclass->getall(0, 9, `status` = 'activate' and `sales` > 0 , `sales` desc); abr('topauthors', $topauthors); abr('topauthorscount', $usersclass->foundrows); abr('emptythumb', (9-$usersclass->foundrows)); #随机分类 $randcategories = array_rand($maincategories, 5); abr('randcategories', $randcategories); #最低价格 $lowprice = $itemsclass->getall(0, 1, `status` = 'active' , `price` asc); if(is_array($lowprice)) { $lowprice = array_shift($lowprice); $lowprice = $lowprice['price']; } abr('lowprice', $lowprice); #快讯 require_once root_path.'/apps/qnews/models/qnews.class.php'; $qnews = new qnews(); $data = array(); foreach($qnews->getall(0, 1, `visible` = 'true') as $key => $value) { if($value['photo']) { $data[$key] = $value; $data[$key]['thumb'] = 'static/uploads/qnews/260x140/' . $value['photo']; } } abr('qnews_data', $data); #面包屑 abr('breadcrumb', ''.$langarray['home'].'');//读取所有tags require_once root_path. /apps/tags/models/tags.class.php;//引入tag的数据库模型类//读取所有tags $tags = new tags();//读取所有tags $gettags = $tags->getall();//获取数据模型,结果为一个数组//读取所有tags abr('tags_new',$gettags);//在smarty模板中加入变量‘tags_new’//读取所有tags {foreach from=$tags_new item=t}//读取所有tags {$t.name}//读取所有tags {/foreach} //开始。。//获取所有一级分类 require_once root_path . /apps/categories/models/categories.class.php; $categoriesclass = new categories(); $allcategories_0 = $categoriesclass->getall(0, 0, `visible` = 'true' and `sub_of`=0 ); $data = array(); foreach ($allcategories_0 as $categories_data) { //获取当前分类子分类 $categories_son = $categoriesclass->getall(0, 0, `visible` = 'true' and `sub_of`= .intval($categories_data['id']). ); //获取一级分类下得所有作品 $wherequery = and `id` in (select `item_id` from `items_to_category` where `categories` like '%,.intval($categories_data['id']).,%') ; $items = $itemsclass->getall(0, 0, `status` = 'active' .$wherequery); $data[$categories_data['id']][] = array( 'categories' => $categories_data, 'categories_son' => $categories_son, 'items' => $items ); } abr('data',$data); ?>

网站地址
点击上面的任意按钮是不是触发分类列表,那也要对分类列表的数字限制进行修改。
其它类似信息

推荐信息