バージョン選択

フォーラム

メニュー

オンライン状況

56 人のユーザが現在オンラインです。 (49 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 56
もっと...

サイト内検索

質問 > フロント機能 > 「メインビジュアルスライドショープラグイン」のランダム表示がしたいです。

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
NB0
投稿日時: 2017/4/8 17:06
対応状況: −−−
新米
登録日: 2014/11/2
居住地:
投稿: 10
Re: 「メインビジュアルスライドショープラグイン」のランダム表示がしたいです。
ありがとうございます。
おっしゃる通りrandom関数で表示部をランダム表示することに成功しました。
しかし、メインイメージとサムネイルイメージが一致しないという不具合が発生しております。

サムネイルイメージをクリックすれば対応したメインイメージに変わるというデフォルトの機能ですが、

function lfGetMainImageList()
function lfGetMainImageThumbnailList()

この2つの関数の取得部をrandomにしたので、それぞれがランダム取得という事で一致しないことは必然といえばそうですが…。

これをメインイメージとサムネイルイメージを一致させる方法はありますでしょうか?

念のためコードを記載します。



function action() {
$this->arrMainImageListFree = $this->lfGetMainImageList();
$this->arrMainImageOption = $this->lfGetMainImageOption();
$this->tpl_peger = $this->tplPeger();
$this->tpl_peger_tag = $this->tplPegerTag();

$PThumnaiList = $this->lfGetMainImageThumbnailList();
}

function lfGetMainImageList() {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = "*";
$where = "del_flg = 0";
$table = "plg_dtb_main_image";
$objQuery->setOrder("random()");
$arrRet = $objQuery->select($col, $table, $where);
return $arrRet;
}

function lfGetMainImageThumbnailList() {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = "main_image_image2,main_image_title1";
$where = "del_flg = 0";
$table = "plg_dtb_main_image";
$objQuery->setOrder("random()");
$arrRet = $objQuery->select($col, $table, $where);


foreach ($arrRet as $key => $ThumnaiList) {
$PThumnaiList .= "<div><img class=\"peger_thumbnail\" src=\"" . IMAGE_SAVE_URLPATH . $ThumnaiList['main_image_image2'] . "\" alt=\"" . $ThumnaiList['main_image_title1'] . "\"/></div>";

}

return $PThumnaiList;
}

function lfGetMainImageOption() {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = "*";
$where = "";
$table = "plg_dtb_main_image_option";
$arrRet = $objQuery->select($col, $table, $where);
return $arrRet;
}

function tplPeger() {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = "main_image_peger";
$where = "";
$table = "plg_dtb_main_image_option";
$arrRet = $objQuery->select($col, $table, $where);
if($arrRet[0]['main_image_peger'] == "number"){
$div = "data-cycle-pager=\"#custom-pager\" data-cycle-pager-template=\"<span><a href=#> {{slideNum}} </a></span>\"";
}elseif($arrRet[0]['main_image_peger'] == "thumbnail"){
$div = "data-cycle-pager=\"#adv-custom-pager\" data-cycle-pager-template=\"\"";
}

return $this->tpl_peger = $div;
}

function tplPegerTag() {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$col = "main_image_peger";
$where = "";
$table = "plg_dtb_main_image_option";
$arrRet = $objQuery->select($col, $table, $where);

if($arrRet[0]['main_image_peger'] == "number"){
$tag = "<div id=\"custom-pager\" class=\"center cycle-pager\"></div>";
}elseif($arrRet[0]['main_image_peger'] == "thumbnail"){
$tag = "<div id=\"adv-custom-pager\" class=\"center cycle-pager\">" . $this->lfGetMainImageThumbnailList() . "</div>";
}elseif($arrRet[0]['main_image_peger'] == "standerd"){
$tag = "<p class=\"cycle-pager\"></p>";
}

return $this->tpl_peger_tag = $tag;
}



function lfGetMainImageList()
function lfGetMainImageThumbnailList()
の中の
$objQuery->setOrder("rank DESC");

$objQuery->setOrder("random()");
に変えました。

よろしくお願い致します。
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   「メインビジュアルスライドショープラグイン」のランダム表示がしたいです。 NB0 2017/4/5 18:24
     Re: 「メインビジュアルスライドショープラグイン」のランダム表示がしたいです。 umebius 2017/4/5 23:05
     » Re: 「メインビジュアルスライドショープラグイン」のランダム表示がしたいです。 NB0 2017/4/8 17:06

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,281名です
総投稿数は110,072件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1652
8
red
1570
9
mcontact
1301
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.