JMBSoft.Com Forum Archive

Archive created on 7/30/2013
It may not have all the eye candy as the original forums but at least we were able to save the info contained in them! :)

Hosted by UnofficialJMBSupport.Com

Forums - Support Tickets


Discussion Forums

Forum Index | TubeX Chat

Messages 1 - 11 of 11
To play videos by sponsor
daddymugs
Posted: 2011-06-27 13:53:31

ok so i have setup on our site the videos by sponsors using {template file="global-sponsors.tpl"} in the index.tpl and it displays nicely all the sponsors we have the videos for but it is not working correctly when a user clicks on one.

The code is listed below with the videos by site is the only change that was made but we get a error when trying to click on them. How can we correct this so our users can display the videos that are from those specific sponsors?


<div class="section-sidebar-content">
          <div class="header-red">
            <span class="header-red-left"></span>
            <span class="header-red-right"></span>
            <span class="header-red-text">{"Videos By Site"}</span>
          </div>

          {sponsors var=$sponsors}

          <div class="fs105" align="left" style="height:150px; width:265px; overflow:auto">
          {foreach var=$sponsor from=$sponsors}
            &rsaquo; 
          <a href="{$g_config.base_uri}/custom.php?t=videos-by-sponsor&amp;sponsor={$sponsor.name|urlencode}">{$sponsor.name}</a><br />
          {/foreach}
          </div>

        </div>
jeremy
Posted: 2011-06-27 19:19:25

For that link to work you would need to have a template file named custom-videos-by-sponsor.tpl which contains the complete template code to display the videos you want to appear.
daddymugs
Posted: 2011-06-27 19:53:26

ok jeremy i did get a grasp of that as i worked with this great script of yours here.

Question, Could u possibly show me a snippet of code to get on the right track here so i can get the sponsors viewing to work or perhaps u have a page already? no matter what i have tried today i just keep coming up with no dice.

Thank you so much for the timely reply!

Rich
daddymugs
Posted: 2011-06-28 10:09:34

Ok i have this working except for some reason i can not get the sponsor name put up on the page and the multiple pages of sponsors

Issue #1 about the sponsor name being displayed

here is what i have for that part


<div class="main-content page-content">
<span class="section-left">

{videos
var=$videos
amount=56
sponsor=$g_get_vars.sponsor
paginate=true
pagination=$pagination
sort="date_added DESC"}

<div class="section-content section-videos">
<div class="header">
<span class="header-left"></span>
<span class="header-right"></span>
<span class="header-text">{"_Text:Videos"} {$pagination.start} - {$pagination.end} {"_Text:of"} {$pagination.total} {"_Text:Tagged With"}: {$sponsor}</span>
</div>

I bieleve my problem lies after the Tagged with issue but am i using the wrong variable here?

Issue # 2 - about the multiple pages of sponsors. I use a template called custom-videos-by-sponsor and i notice that with the paging, it is going back to the normal
videos not to the 2nd page of sponsor videos?

<div class="pagination">
{if $pagination.total}
{template file="global-pagination.tpl" uri="index.php?r=sponsor&sponsor=$sponsor.name&p="}
{/if}
</div>
</span>
jeremy
Posted: 2011-06-28 21:27:34

To select by sponsor using a variable, the variable needs to contain the sponsor ID. Therefore, the link to the page would need to be this:

<a href="{$g_config.base_uri}/custom.php?t=videos-by-sponsor&amp;sponsor={$sponsor.sponsor_id}">{$sponsor.name}</a>

You can use the same {videos} template function with this updated link, and that should then pull the correct videos for that sponsor. The pagination link would also need to be updated, like so:

{template file="global-pagination.tpl" uri="custom.php?t=videos-by-sponsor&sponsor=$sponsor.sponsor_id&p="}
daddymugs
Posted: 2011-06-29 09:03:37

I did those changes and still not getting the name to be displayed on the view by site when it populates, with the pagination part it when going to page 2 it displays no more videos even though it of course does have them.perhaps i made a mistake i'll be looking at it again but pretty sure i copy and pasted it correctly.

The part from my global.sponsors

{sponsors var=$sponsors}

<div class="fs105" align="left" style="height:150px; width:265px; overflow:auto">
{foreach var=$sponsor from=$sponsors}
&rsaquo;
<a href="{$g_config.base_uri}/custom.php?t=videos-by-sponsor&amp;sponsor={$sponsor.sponsor_id}">{$sponsor.name}</a><br />

{/foreach}
</div>

The parts from my custom-videos-by-sponsor

{videos
var=$videos
amount=56
sponsor=$g_get_vars.sponsor
paginate=true
pagination=$pagination
sort="date_added DESC"}

<div class="section-content section-videos">
<div class="header">
<span class="header-left"></span>
<span class="header-right"></span>
<span class="header-text">{"_Text:Videos"} {$pagination.start} - {$pagination.end} {"_Text:of"} {$pagination.total} : {$sponsor.name}</span>
</div>

<div class="pagination">
{if $pagination.total}
{template file="global-pagination.tpl" uri="custom.php?t=videos-by-sponsor&sponsor=$sponsor.sponsor_id&p="}
{/if}
</div>

jeremy
Posted: 2011-06-30 20:33:29

Please provide the URL and login information for your software control panel so I can take a look. Use the Private Message field when submitting a reply to this topic to provide that information securely.
daddymugs
Posted: 2011-07-01 01:51:23

ok - thanks
jeremy
Posted: 2011-07-04 08:13:37

I am not able to access the login information provided; it looks like you may have edited the private message which overwrites it's original contents. Please provide that information again.
daddymugs
Posted: 2011-07-05 20:34:00

ok should be good now
jeremy
Posted: 2011-07-06 20:20:27

I've added a {sponsor} template tag to the custom-videos-by-sponsor.tpl template to pull in the sponsor information, and the sponsor videos page now looks to be working properly.
Messages 1 - 11 of 11