コード例 #1
0
ファイル: program.php プロジェクト: jesus143/fs-dev
function look_views($access)
{
    $mc = new myclass();
    if ($access[0] == 'home') {
        $look = get_all_look_latest();
        // $look = set_latest_look();
        // $look[4][0]='1.jpg';
        // echo "string";
        // $look = set_latest_look( );
    } else {
        if ($access[0] == 'ratealook') {
            if (($_SESSION['rate_Show_Me'] == 1 or empty($_SESSION['rate_Show_Me'])) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                $look = all_look_i_have_rated('newest');
                // $_SESSION['sort_alihr']='newest';
                $_SESSION['sort_alihr'] = 'oldest';
                echo "Show me (all looks) That i (have rated) sort by (newest)";
                $location = 'all_looks';
                // $stat='rated'
                print_r($look);
            } else {
                if (($_SESSION['rate_Show_Me'] == 1 or empty($_SESSION['rate_Show_Me'])) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                    $look = all_look_i_have_rated('oldest');
                    // $_SESSION['sort_alihr']='oldest';
                    $_SESSION['sort_alihr'] = 'newest';
                    echo "Show me (all looks) That i (have rated) sort by (oldest)";
                    $location = 'all_looks';
                    print_r($look);
                    // $stat='rated'
                } else {
                    if (($_SESSION['rate_Show_Me'] == 1 or empty($_SESSION['rate_Show_Me'])) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                        # Show me (all looks) That i (have not rated) sort by (newest)
                        echo "Show me (all looks) That i (have not rated) sort by (newest)";
                        // $_SESSION['sort_alihnr']='newest';
                        $_SESSION['sort_alihnr'] = 'oldest';
                        $look = all_look_i_have_not_rated($_SESSION['sort_alihnr']);
                        $location = 'all_looks';
                        print_r($look);
                        // $stat='not rated'
                    } else {
                        if (($_SESSION['rate_Show_Me'] == 1 or empty($_SESSION['rate_Show_Me'])) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                            # Show me (all looks) That i (have not rated) sort by (oldest)
                            echo "Show me (all looks) That i (have not rated) sort by (oldest)";
                            // $_SESSION['sort_alihnr']='oldest';
                            $_SESSION['sort_alihnr'] = 'newest';
                            $look = all_look_i_have_not_rated($_SESSION['sort_alihnr']);
                            $location = 'all_looks';
                            print_r($look);
                            // $stat='not rated'
                        } else {
                            if ($_SESSION['rate_Show_Me'] == 2 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                # Show me (all looks) That i (have not rated) sort by (newest)
                                echo "Show me (Top rated) That i (have rated) sort by (newest)";
                                // $_SESSION['trlihr']='newest';
                                $_SESSION['trlihr'] = 'oldest';
                                $look = topratedlook_i_have_rated($_SESSION['trlihr']);
                                echo " count = " . count($look) . '<br>';
                                $location = 'top_rated';
                                print_r($look);
                                // $stat='rated'
                            } else {
                                if ($_SESSION['rate_Show_Me'] == 2 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                    # Show me (all looks) That i (have not rated) sort by (oldest)
                                    echo "Show me (Top rated) That i (have rated) sort by (oldest)";
                                    // $_SESSION['trlihr']='oldest';
                                    $_SESSION['trlihr'] = 'newest';
                                    $look = topratedlook_i_have_rated($_SESSION['trlihr']);
                                    echo " count = " . count($look) . '<br>';
                                    $location = 'top_rated';
                                    print_r($look);
                                    // $stat='rated'
                                } else {
                                    if ($_SESSION['rate_Show_Me'] == 2 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                        # Show me (all looks) That i (have not rated) sort by (oldest)
                                        echo "Show me (Top rated) That i (have not rated) sort by (newest)";
                                        // $_SESSION['trlihnr']='newest';
                                        $_SESSION['trlihnr'] = 'oldest';
                                        $look = topratedlook_i_have_not_rated($_SESSION['trlihnr']);
                                        echo " count = " . count($look) . '<br>';
                                        $location = 'top_rated';
                                        print_r($look);
                                        // $stat='not rated'
                                    } else {
                                        if ($_SESSION['rate_Show_Me'] == 2 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                            # Show me (all looks) That i (have not rated) sort by (oldest)
                                            echo "Show me (Top rated) That i (have not rated) sort by (oldest)";
                                            // $_SESSION['trlihnr']='oldest';
                                            $_SESSION['trlihnr'] = 'newest';
                                            $look = topratedlook_i_have_not_rated($_SESSION['trlihnr']);
                                            echo " count = " . count($look) . '<br>';
                                            $location = 'top_rated';
                                            print_r($look);
                                            // $stat='not rated'
                                        } else {
                                            if ($_SESSION['rate_Show_Me'] == 3 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                                echo "Show me (Most Viewed) That i (have rated) sort by (newest)";
                                                // $_SESSION['mvihr']='newest';
                                                $_SESSION['mvihr'] = 'oldest';
                                                $look = most_viewed_i_have_rated($_SESSION['mvihr']);
                                                echo " count = " . count($look) . '<br>';
                                                $location = 'most_viewed';
                                                print_r($look);
                                                // $stat='rated'
                                            } else {
                                                if ($_SESSION['rate_Show_Me'] == 3 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                                    echo "Show me (Most Viewed) That i (have rated) sort by (oldest)";
                                                    // $_SESSION['mvihr']='oldest';
                                                    $_SESSION['mvihr'] = 'newest';
                                                    $look = most_viewed_i_have_rated($_SESSION['mvihr']);
                                                    echo " count = " . count($look) . '<br>';
                                                    $location = 'most_viewed';
                                                    print_r($look);
                                                    // $stat='rated'
                                                } else {
                                                    if ($_SESSION['rate_Show_Me'] == 3 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                                        echo "Show me (Most Viewed) That i (have not rated) sort by (newest)";
                                                        // $_SESSION['mvihnr']='newest';
                                                        $_SESSION['mvihnr'] = 'oldest';
                                                        $look = most_viewed_i_have_not_rated($_SESSION['mvihnr']);
                                                        echo " count = " . count($look) . '<br>';
                                                        $location = 'most_viewed';
                                                        print_r($look);
                                                        // $stat='rated'
                                                    } else {
                                                        if ($_SESSION['rate_Show_Me'] == 3 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                                            echo "Show me (Most Viewed) That i (have not rated) sort by (oldest)";
                                                            // $_SESSION['mvihnr']='oldest';
                                                            $_SESSION['mvihnr'] = 'newest';
                                                            $look = most_viewed_i_have_not_rated($_SESSION['mvihnr']);
                                                            echo " count = " . count($look) . '<br>';
                                                            $location = 'most_viewed';
                                                            print_r($look);
                                                            // $stat='rated'
                                                        } else {
                                                            if ($_SESSION['rate_Show_Me'] == 4 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                                                echo "Show me (Most Discussed) That i (have rated) sort by (newest)";
                                                                // $_SESSION['mdihr']='newest';
                                                                $_SESSION['mdihr'] = 'oldest';
                                                                $look = most_discussed_i_have_rated($_SESSION['mdihr']);
                                                                echo " count = " . count($look) . '<br>';
                                                                $location = 'most_discussed';
                                                                print_r($look);
                                                                // $stat='rated'
                                                            } else {
                                                                if ($_SESSION['rate_Show_Me'] == 4 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 1 or empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                                                    echo "Show me (Most Discussed) That i (have rated) sort by (oldest)";
                                                                    // $_SESSION['mdihr']='oldest';
                                                                    $_SESSION['mdihr'] = 'newest';
                                                                    $look = most_discussed_i_have_rated($_SESSION['mdihr']);
                                                                    echo " count = " . count($look) . '<br>';
                                                                    $location = 'most_discussed';
                                                                    print_r($look);
                                                                    // $stat='rated'
                                                                } else {
                                                                    if ($_SESSION['rate_Show_Me'] == 4 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 1 or empty($_SESSION['rate_Sort_By']))) {
                                                                        echo "Show me (Most Discussed) That i (have not rated) sort by (newest)";
                                                                        // $_SESSION['mdihnr']='newest';
                                                                        $_SESSION['mdihnr'] = 'oldest';
                                                                        $look = most_discussed_i_have_not_rated($_SESSION['mdihnr']);
                                                                        echo " count = " . count($look) . '<br>';
                                                                        $location = 'most_discussed';
                                                                        print_r($look);
                                                                        // $stat='rated'
                                                                    } else {
                                                                        if ($_SESSION['rate_Show_Me'] == 4 and !empty($_SESSION['rate_Show_Me']) and ($_SESSION['rate_That_I'] == 2 and !empty($_SESSION['rate_That_I'])) and ($_SESSION['rate_Sort_By'] == 2 and !empty($_SESSION['rate_Sort_By']))) {
                                                                            echo "Show me (Most Discussed) That i (have not rated) sort by (oldest)";
                                                                            // $_SESSION['mdihnr']='oldest';
                                                                            $_SESSION['mdihnr'] = 'newest';
                                                                            $look = most_discussed_i_have_not_rated($_SESSION['mdihnr']);
                                                                            echo " count = " . count($look) . '<br>';
                                                                            $location = 'most_discussed';
                                                                            print_r($look);
                                                                            // $stat='rated'
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if ($_SESSION['rate_That_I'] == 2) {
                $stat = 'not rated';
                // echo "not rated";
            } else {
                $stat = 'rated';
                // echo "rated";
            }
        }
    }
    if (empty($look[0]) or empty($look[0][0])) {
        // echo "looks are empty";
    } else {
        $look = insert_adds($look, get_all_ads_id());
        for ($i = 0; $i < count($look); $i++) {
            echo "{$i} .) plno = " . $look[$i][0] . " value = " . $look[$i][1] . '<br>';
        }
        $mc = new myclass();
        $tm = $mc->top_member();
        $initpage = $access[1];
        $endpage = $access[1] + 6;
        // $_SESSION['Tuser'] = count($tm) ;
        // $_SESSION['pageNum'] = $initpage;
        if ($initpage < count($look)) {
            # code...
            for ($i = $initpage; $i < $endpage; $i++) {
                if ($i < count($look)) {
                    if ($look[$i][1] == 'ads') {
                        ads($look[$i][0]);
                    } else {
                        // if (count($look[0])>1) {
                        // if ($location == 'most_viewed') {
                        // 	$plno = $look[$i][0];
                        // 	$Trate = get_1look_percentage($plno,$stat);
                        // }else {
                        $plno = $look[$i][0];
                        // $Trate = get_1look_percentage($plno,$stat);
                        $Trate = get_ownlook_total_ratings($plno);
                        // }
                        // $Trate = $look[$i][1];
                        // echo " plno = $plno and Trate = $Trate<br>";
                        // get_1look_percentage(940,'rated');
                        // }else{
                        // 	$plno = $look[$i];
                        // 	// echo "1d";
                        // }
                        $plinfo = $mc->posted_look_info($plno);
                        $mno = $plinfo['mno'];
                        $mem_info = $mc->user($mno);
                        echo "\n\t\t\t\t\t\t\t\t\t\t\t<style>\n\t\t\t\t\t\t\t\t\t\t\t\t.stands b{\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolor:#000\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</style>\n\t\t\t\t\t\t\t\t\t\t";
                        echo "\n\t\t\t\t\t\t\t\t\t\t\t<li >\n\t\t\t\t\t\t\t\t\t\t\t\t<div onmouseover=\"showRate({$plno},'block')\" onmouseout=\"showRate({$plno},'none')\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='position:absolute;display:none;' id='rate{$plno}'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='position:absolute;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='position:relative;left:44px;top:-20px;'><img src='images/corner.png' /></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='position:absolute;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"overflow:hidden;font:bold 12px 'helvetica';padding:10px;position:relative;left:50px;top:15px;background:url('images/trans-back.png');width:218px;color:white\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b style=\"font:bold 15px 'helvetica'\">" . $plinfo["lookName"] . "</b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $plinfo["lookAbout"] . "<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPosted on " . $plinfo["date_"] . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='rate' style='background:white;WIDTH:35px;padding:1px;position:relative;left:5px;top:-20px;border:1px solid #6d6d6d' >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"padding:5px 2px 5px 2px;background:#02c7ea;font:bold 11px 'helvetica';color:#fff\">{$Trate}%</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style=\"padding:0px;background:white;font:12px helveticaBold;color:#3b3b3b\">RATE</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id='r5' onclick=\"ratethis({$plno},5)\">5</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id='r4' onclick=\"ratethis({$plno},4)\" >4</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id='r3' onclick=\"ratethis({$plno},3)\" >3</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id='r2' onclick=\"ratethis({$plno},2)\" >2</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id='r1' onclick=\"ratethis({$plno},1)\" >1</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div onclick=\"dripthis({$plno})\" style=\"background:white url('images/drip.png') center no-repeat\">&nbsp;</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div onclick=\"lovethis({$plno})\"  style=\"background:white url('images/love.png') center no-repeat\">&nbsp;</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<table border=0 width=100% >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign=top align=center >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div>";
                        // look posted
                        // echo"<a href='lookdetails.php?id=$plno'><img src='images/members/posted looks/$plno.jpg' style='width:287px;height:450px'  /></a>";
                        echo "<a href='lookdetails.php?id={$plno}'><img src='images/members/posted looks/home/{$plno}.jpg' style='width:287px;height:450px'  /></a>";
                        echo "</div>";
                        echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='padding:5px;'></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<table width=100% class='stands' border=0>";
                        if (file_exists("../images/members/{$mno}.jpg")) {
                            echo "<td width=1><a  ><img src='images/members/" . $mno . ".jpg' width=50px height=53px style='margin-top:6px;' /></a></td>";
                        } else {
                            echo "<td width=1><a ><img src='images/members/0.jpg' width=50px height=53px style='margin-top:6px;' /></a></td>";
                        }
                        echo "\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td style='padding:5px;'> ";
                        // echo "<a href='".$rsmemq["username"]."' style='color:#454545;font:15px helveticaBold;text-decoration:none;//text-transform:uppercase'>".$rsmemq["firstname"]." ".$rsmemq["lastname"]."</a><br>";
                        echo "<a  style='color:#454545;font:12px helveticaBold;text-decoration:none;//text-transform:uppercase'>" . $mem_info["firstname"] . " " . $mem_info["lastname"] . " </a> <span style='font-size:11px'>posted a new look </span><br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style='color:#454545;font:11px helvetica; font-weight:bold;' >" . $plinfo['tlrates'] . " Rates |  Ratings " . $Trate . "%</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<table style='width:auto;color:#454545;font:bold 11px helvetica' border=0>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td > <b>{$plinfo['tldrips']}</b></td><td><img  title='drip' src='images/drip.png' height=10 /></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td > | <b>{$plinfo['tllove']}</b></td><td><img title='love' src='images/love.png' height=10 /></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td> |  " . $plinfo['tlcomments'] . " Comments</b></td> \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</table>";
                        // <span style='font-size:11px;font-weight:bold'> [$access[1] i=$i]".get_look_tview($plno)." total Views</span>
                        echo "<span style='font-size:11px;font-weight:bold'> " . get_look_tview($plno) . " total Views</span>";
                        echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign=center ><br><img src='images/look-icon.png' /></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t";
                    }
                }
            }
        }
    }
}
コード例 #2
0
ファイル: library.php プロジェクト: jesus143/fs-dev
function set_latest_look()
{
    $session_latest_look = $_SESSION['latest_look'];
    if (empty($session_latest_look)) {
        // echo " session latest look is empty";
        // echo " get all looks";
        // echo " get the len of all look and store to sesson";
        $session_latest_look = get_all_look_latest();
        $session_latest_look = insert_adds($session_latest_look, get_all_ads_id());
        $_SESSION['old_look_len'] = get_table_len('postedlooks');
    } else {
        // echo " get new len and compare to last checked len";
        // echo " session latest look is not empty";
        // echo " check the total lenof";
        $new_look_len = get_table_len('postedlooks');
        if ($_SESSION['old_look_len'] != $new_look_len) {
            $_SESSION['old_look_len'] = $new_look_len;
            $session_latest_look = get_all_look_latest();
            $session_latest_look = insert_adds($session_latest_look, get_all_ads_id());
            // echo " ";
            // echo " and len is not equal ";
        }
    }
    // $len = get_table_len( 'postedlooks' );
    // echo " look len = $len <br>";
    $_SESSION['latest_look'] = $session_latest_look;
    return $session_latest_look;
}