Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Banned
    Join Date
    Oct 2003
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please help, I am begging.

    I have been sitting here for hours trying to figure this one out.

    I have an adult video sharing and I am trying to get my channel pages to display via the sql database specific pages about that channel.

    Most Recent
    Most Viewed
    Most Discussed
    Top Favorites
    Top Rated

    But only in that channel when that channel is originally chosen.

    I know the problem lies in the php file which I have completely destroyed not knowing sql functions. Would someone here be a love and look at my php script and tell me what is wrong and why it is not calling these pages.


    This is my channel_detail.php file.
    PHP Code:
    <?php
    session_start
    ();
    include(
    "include/config.php");
    include(
    "include/function.php");

    if (
    $config['approve'] == 1) {$active "and active = '1'";}

    if(
    $_REQUEST[page]=="")
    $page 1;
    else
    $page $_REQUEST[page];

    if(
    $_REQUEST[category]!="rd" && $_REQUEST[category]!="mv" && $_REQUEST[category]!="md" && $_REQUEST[category]!="tf" && $_REQUEST[category]!="tr" && $_REQUEST[category]!="rf")
            
    $category="mr";
    else
            
    $category $_REQUEST[category];

    if(
    $category=="mr")$sql "SELECT count(*) as total from video where type='public' order by addtime desc limit $config[total_per_ini]";
    elseif(
    $category=="mv")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' order by viewnumber desc limit $config[total_per_ini]";
    elseif(
    $category=="md")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' order by com_num desc limit $config[total_per_ini]";
    elseif(
    $category=="tf")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' order by fav_num desc limit $config[total_per_ini]";
    elseif(
    $category=="tr")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' order by ratedby*rate desc limit $config[total_per_ini]";
    elseif(
    $category=="rf")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' and featured='yes' order by addtime desc limit $config[total_per_ini]";
    elseif(
    $category=="rd")$sql "SELECT count(*) as total from `channel` FROM `video` where type='public' order by rand() limit $config[total_per_ini]";

    $ars $conn->Execute($sql);
    if(
    $ars->fields['total']<=$config[total_per_ini])$total $ars->fields['total'];
    else 
    $total $config[total_per_ini];
    $tpage ceil($total/$config[items_per_page]);
    if(
    $tpage==0$spage=$tpage+1;
    else 
    $spage $tpage;
    $startfrom = ($page-1)*$config[items_per_page];
    //generate next and previous

    $next="";

    $prev="";

    $next_page=$page+1;

    $prev_page=$page-1;

    if(
    $page>&& $page<$spage)

    {

    $next="<b><a href='channel_detail.php?page=$next_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Next Page]</a><b>";

    $prev="<b><a href='channel_detail.php?page=$prev_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Previous Page]</a><b>";

    }

    else if(
    $page<$spage)

    {

    $next="<b><a href='channel_detail.php?page=$next_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Next Page]</a><b>";

    }

    else if(
    $page>&& $page=$spage)

    {

    $prev="<b><a href='channel_detail.php?page=$prev_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Previous Page]</a><b>";

    }



    if(
    $category=="mr")$sql="SELECT * from video where type='public' $active order by addtime desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="mv")$sql="SELECT * `channel` FROM `video` where type='public' $active order by viewnumber desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="md")$sql="SELECT * `channel` FROM `video` where type='public' $active order by com_num desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="tf")$sql="SELECT * `channel` FROM `video` where type='public' $active order by fav_num desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="tr")$sql="SELECT * `channel` FROM `video` where type='public' $active order by (ratedby*rate) desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="rf")$sql="SELECT * `channel` FROM `video` where type='public' $active and featured='yes' order by addtime desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="rd")$sql="SELECT * `channel` FROM `video` where type='public' $active order by rand() limit $startfrom, $config[items_per_page]";



    $rs $conn->Execute($sql);

    $users $rs->getrows();

    $start_num=$startfrom+1;

    $end_num=$startfrom+$rs->recordcount();



    $page_link="";
    $k=1;

    for(
    $k=1$k<$page$k++)
    {if (
    $k%30==0) {$page_link.="<BR>";} $page_link.="<a href='channel_detail.php?page=$k&viewtype=$_REQUEST[viewtype]&category=$category'>$k</a>&nbsp;&nbsp;";}

    if (
    $k==$page):
    {
    $page_link.="<SPAN style=\"padding:2px; background: #000000; border:1px solid #FFFFFF; font-size:12px;\">$k</SPAN>&nbsp;&nbsp;";}
    endif;

    if (
    $k%30==0) {$page_link.="<BR>";}

    for(
    $k=$page+1;$k<=$tpage;$k++)
    {if (
    $k%30==0) {$page_link.="<BR>";}$page_link.="<a href='video.php?page=$k&viewtype=$_REQUEST[viewtype]&category=$category'>$k</a>&nbsp;&nbsp;";}

    $sql="SELECT count(*) as total from video WHERE channel like '%|$_REQUEST[chid]|%' AND type='public' $active limit $config[total_per_ini]";
    $ars $conn->Execute($sql);
    $total $ars->fields['total'];
    $tpage ceil($total/$config[items_per_page]);
    if(
    $tpage==0$spage=$tpage+1;
    else 
    $spage $tpage;
    $startfrom = ($page-1)*$config[items_per_page];
    $next="";
    $prev="";
    $next_page=$page+1;
    $prev_page=$page-1;
    if(
    $page>&& $page<$spage)
    {
            
    $next="<b><a href='channel_detail.php?page=$next_page&chid=$_REQUEST[chid]'>next</a><b>";
            
    $prev="<b><a href='channel_detail.php?page=$prev_page'>prev</a><b>";
    }
    else if(
    $page<$spage)
    {
            
    $next="<b><a href='channel_detail.php?page=$next_page&chid=$_REQUEST[chid]'>next</a><b>";
    }
    else if(
    $page>&& $page=$spage)
    {
            
    $prev="<b><a href='channel_detail.php?page=$prev_page&chid=$_REQUEST[chid]'>prev</a><b>";
    }

    $sql="SELECT * from channel WHERE CHID=$_REQUEST[chid]";
    $rs $conn->Execute($sql);
    if(
    $rs->recordcount()>0)
    {
      
    $users $rs->getrows();
      
    $sql="SELECT count(VID) as total, UID from video WHERE channel like '%|$_REQUEST[chid]|%' $active group by UID order by total desc limit 3";
      
    $rsx $conn->Execute($sql);
      
    $tmpary $rsx->getrows();
      
    STemplate::assign('actuser',$tmpary);

      
    $sql="SELECT * from video WHERE type='public' and channel like '%|$_REQUEST[chid]|%' $active order by viewnumber desc limit 3";
      
    $rsx $conn->Execute($sql);
      
    $tmpary $rsx->getrows();
      
    STemplate::assign('mostview',$tmpary);

      
    $sql="SELECT * from video WHERE type='public' and channel like '%|$_REQUEST[chid]|%' $active order by addtime desc limit $startfrom, $config[items_per_page]";
      
    $rsx $conn->Execute($sql);
      
    $tmpary $rsx->getrows();
      
    STemplate::assign('recadd',$tmpary);
    }

    //$users = $rs->getrows();
    $start_num=$startfrom+1;
    $end_num=$startfrom+$rs->recordcount();

    $page_link="";
    for(
    $k=1;$k<=$tpage;$k++){ 
            
            
    $page_link.="<a href='channel_detail.php?page=$k&chid=$_REQUEST[chid]'>$k</a>&nbsp;&nbsp;";
    }

    //END PAGING

    //PAGING




    //END PAGING

    //RECENT CLOUD TAGS

    $recenttagsquery="SELECT keyword from video where type='public' and channel like '%|$_REQUEST[chid]|%' $active order by addtime desc limit 21";
    $recenttags=cloudTags($recenttagsquery);
    STemplate::assign('recenttags',$recenttags);

    //END CLOUD TAGS

    STemplate::assign('err',$err);
    STemplate::assign('msg',$msg);
    STemplate::assign('page',$page);
    STemplate::assign('start_num',$start_num);
    STemplate::assign('end_num',$end_num);
    STemplate::assign('placement',$placement);
    STemplate::assign('page_link',$page_link);
    STemplate::assign('total',$total);
    STemplate::assign('total2',$rsx->recordcount());
    STemplate::assign('answers',$users);
    STemplate::assign('next',$next);
    STemplate::assign('prev',$prev);
    STemplate::assign('head_bottom',"videolinks.tpl");
    STemplate::display('head1.tpl');
    STemplate::display('err_msg.tpl');
    STemplate::display('channel_detail.tpl');
    //STemplate::display('right.tpl');
    STemplate::display('footer3.tpl');
    ?>
    I will post the link to the channels page so you can get an idea of what I am talking about in my next post in this thread. I am doing this because just in case I am not allowed to post a link to my website because it is adult content, Moderator please just delete my next post in this thread.

    If you look at this page you will see under "Video Options - Change things around" Those links are what I am referring to.

    Please help I AM BEGGING.
    Last edited by dominickm; 08-24-2007 at 04:36 AM.

  • #2
    Banned
    Join Date
    Oct 2003
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I removed the link because I just read the terms of this site. If you want the link to the page in question please PM me. Thank you in advance.
    Last edited by dominickm; 08-24-2007 at 05:05 AM.

  • #3
    Banned
    Join Date
    Oct 2003
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is my video.php file just in case you need the reference. This works fine for what it needs to do. This pulls from all video channels.

    PHP Code:
    <?php
    session_start
    ();
    include(
    "include/config.php");
    include(
    "include/function.php");


    //PAGING
    if($_REQUEST[page]=="")
    $page 1;
    else
    $page $_REQUEST[page];

    if(
    $_REQUEST[category]!="rd" && $_REQUEST[category]!="mv" && $_REQUEST[category]!="md" && $_REQUEST[category]!="tf" && $_REQUEST[category]!="tr" && $_REQUEST[category]!="rf")
            
    $category="mr";
    else
            
    $category $_REQUEST[category];

    if(
    $category=="mr")$sql "SELECT count(*) as total from video where type='public' order by addtime desc limit $config[total_per_ini]";
    elseif(
    $category=="mv")$sql "SELECT count(*) as total from video where type='public' order by viewnumber desc limit $config[total_per_ini]";
    elseif(
    $category=="md")$sql "SELECT count(*) as total from video where type='public' order by com_num desc limit $config[total_per_ini]";
    elseif(
    $category=="tf")$sql "SELECT count(*) as total from video where type='public' order by fav_num desc limit $config[total_per_ini]";
    elseif(
    $category=="tr")$sql "SELECT count(*) as total from video where type='public' order by ratedby*rate desc limit $config[total_per_ini]";
    elseif(
    $category=="rf")$sql "SELECT count(*) as total from video where type='public' and featured='yes' order by addtime desc limit $config[total_per_ini]";
    elseif(
    $category=="rd")$sql "SELECT count(*) as total from video where type='public' order by rand() limit $config[total_per_ini]";

    $ars $conn->Execute($sql);
    if(
    $ars->fields['total']<=$config[total_per_ini])$total $ars->fields['total'];
    else 
    $total $config[total_per_ini];
    $tpage ceil($total/$config[items_per_page]);
    if(
    $tpage==0$spage=$tpage+1;
    else 
    $spage $tpage;
    $startfrom = ($page-1)*$config[items_per_page];
    //generate next and previous

    $next="";

    $prev="";

    $next_page=$page+1;

    $prev_page=$page-1;

    if(
    $page>&& $page<$spage)

    {

    $next="<b><a href='video.php?page=$next_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Next Page]</a><b>";

    $prev="<b><a href='video.php?page=$prev_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Previous Page]</a><b>";

    }

    else if(
    $page<$spage)

    {

    $next="<b><a href='video.php?page=$next_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Next Page]</a><b>";

    }

    else if(
    $page>&& $page=$spage)

    {

    $prev="<b><a href='video.php?page=$prev_page&viewtype=$_REQUEST[viewtype]&category=$category'>[Previous Page]</a><b>";

    }



    if(
    $category=="mr")$sql="SELECT * from video where type='public' $active order by addtime desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="mv")$sql="SELECT * from video where type='public' $active order by viewnumber desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="md")$sql="SELECT * from video where type='public' $active order by com_num desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="tf")$sql="SELECT * from video where type='public' $active order by fav_num desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="tr")$sql="SELECT * from video where type='public' $active order by (ratedby*rate) desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="rf")$sql="SELECT * from video where type='public' $active and featured='yes' order by addtime desc limit $startfrom, $config[items_per_page]";

    elseif(
    $category=="rd")$sql="SELECT * from video where type='public' $active order by rand() limit $startfrom, $config[items_per_page]";



    $rs $conn->Execute($sql);

    $users $rs->getrows();

    $start_num=$startfrom+1;

    $end_num=$startfrom+$rs->recordcount();



    $page_link="";
    $k=1;

    for(
    $k=1$k<$page$k++)
    {if (
    $k%30==0) {$page_link.="<BR>";} $page_link.="<a href='video.php?page=$k&viewtype=$_REQUEST[viewtype]&category=$category'>$k</a>&nbsp;&nbsp;";}

    if (
    $k==$page):
    {
    $page_link.="<SPAN style=\"padding:2px; background: #000000; border:1px solid #FFFFFF; font-size:12px;\">$k</SPAN>&nbsp;&nbsp;";}
    endif;

    if (
    $k%30==0) {$page_link.="<BR>";}

    for(
    $k=$page+1;$k<=$tpage;$k++)
    {if (
    $k%30==0) {$page_link.="<BR>";}$page_link.="<a href='video.php?page=$k&viewtype=$_REQUEST[viewtype]&category=$category'>$k</a>&nbsp;&nbsp;";}

    //END PAGING

    STemplate::assign('err',$err);
    STemplate::assign('msg',$msg);
    STemplate::assign('page',$page);
    STemplate::assign('start_num',$start_num);
    STemplate::assign('end_num',$end_num);
    STemplate::assign('placement',$placement);
    STemplate::assign('page_link',$page_link);
    STemplate::assign('total',$total);
    STemplate::assign('answers',$users);
    STemplate::assign('next',$next);
    STemplate::assign('prev',$prev);
    STemplate::assign('head_bottom',"videolinks.tpl");
    STemplate::display('head1.tpl');
    STemplate::display('err_msg.tpl');
    STemplate::display('search.tpl');
    STemplate::display('video.tpl');
    STemplate::display('footer2.tpl');
    ?>
    Last edited by dominickm; 08-24-2007 at 05:04 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •