Page 1 of 2

loading a page within a frame problem

Posted: 19 Aug 2014, 09:30
by jonasredant
Hi, I'm creating a Manialink for Trackmania United Forever. I know this forum is for Trackmania 2,
but for the older games there aren't many people creating manialinks anymore or visiting that section
of the forum...

I have the following problem:

The first page of the manialink (index.xml) that is displayed is this:

Image

Is has the following code:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<manialink>
    <timeout>0</timeout>
    <type>default</type>

<quad posn="-46 44.5 -31" sizen="92 14" image="http://jonasmanialink.freeiz.com/images/manialink_banner.jpg"></quad>
<include url="http://jonasmanialink.freeiz.com/menu.xml" />
<include url="http://jonasmanialink.freeiz.com/bar_onderaan.xml" />
<quad posn="-64 48 -32" sizen="128 96" image="http://jonasmanialink.freeiz.com/images/background.jpg"></quad>
<!--FRM=index-->
      <frame posn="-36 27 -32">
            <quad posn="0.4 -0.1 1" sizen="96.6 62.7" style="Bgs1" substyle="NavButtonBlink"></quad>
            <quad posn="0 0 2" sizen="97 63" style="Bgs1" substyle="BgCardBuddy"></quad>
            <label posn="49 -3 3" sizen="100 7" halign="center" textsize="8" text="Welcome to my Manialink page!!!" autonewline="1"></label>
            <label posn="49.2 -12.7 3" sizen="87.8 37" halign="center" textsize="4.5" text="Here you can find many things you can use in the game, such as tracks, mods, skins, avatars & horns. They make TrackMania even better and 
more enjoyable!!! Hope you like them ;-)" autonewline="1"></label>
      </frame>
</manialink>
Now suppose I click on Horns in the menu on the left, this button links to horns.xml
My intention is to load this new page in the blue frame on the right of the menu. But when
I do this, the other items like the menu itself, the background image, and the bar disappear
So I have to include the following code in horns.xml again, thus reloading the whole page again.

Code: Select all

<quad posn="-46 44.5 -31" sizen="92 14" image="http://jonasmanialink.freeiz.com/images/manialink_banner.jpg"></quad>
<include url="http://jonasmanialink.freeiz.com/menu.xml" />
<include url="http://jonasmanialink.freeiz.com/bar_onderaan.xml" />
<quad posn="-64 48 -32" sizen="128 96" image="http://jonasmanialink.freeiz.com/images/achtergrond.jpg"></quad>
So I wonder if I can display the content of horns.xml in a frame without having to include every
element (like the background image,...) again.

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 11:08
by Nerpson
In php this would be simple.

Code: Select all

<?php include("file_url"); ?>
and it's done.

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 11:29
by jonasredant
I'm afraid I'm going to need a bit more information. Where do I put this code and what exactly does it?

I think maybe a misunderstanding has arissen: what I want to do is load horns.xml in the blue frame next to the menu when I press the Horns button on the menu. Like you would specify a target to display the content of a link in normal HTML, like for eg <link rel="parent" href="horns.xml" target="framename">

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 12:25
by w1lla
try to work with $_POST and $_GET.

http://www.w3schools.com/php/php_forms.asp

http://pastebin.com/mhdFuY5X shows how it can be dealt within manialink with

Code: Select all

$frame
.

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:14
by jonasredant
I've red the code. But I don't think this will solve the problem.

Suppose someone clicks on "News schreiben", then this executes: manialink="'.$apurl.'?frame=news" so
$frame="news", but I think this would execute lines 18-27 again.
In my case that would be:

Code: Select all

<quad posn="-46 44.5 -31" sizen="92 14" image="http://jonasmanialink.freeiz.com/images/manialink_banner.jpg"></quad>
<include url="http://jonasmanialink.freeiz.com/menu.xml" />
<include url="http://jonasmanialink.freeiz.com/bar_onderaan.xml" />
<quad posn="-64 48 -32" sizen="128 96" image="http://jonasmanialink.freeiz.com/images/achtergrond.jpg"></quad>
thus reloading the menu, banner, bar and background image.
What I want to do is display the elements of the page that are always the same in the background and display new content in a frame without reloading or reexecuting the code that displays the background elements.

P.S. Mss gaat het beter in het nederlands, lol

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:18
by steeffeen
there is no support of dynamically replacing content in a manialink
you always have to load the whole page

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:27
by jonasredant
Then is it because of the cache that every element isn't downloaded again when someone hits for eg Horns on the menu? If a person's cache is full, the whole content of a page (like background image, menus,...) has to be downloaded again?

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:35
by steeffeen
images are cached over long term while the xmls shouldn't be cached (i'm no expert in TMUF things though)

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:36
by jonasredant
@steeffeen
Do you perhaps know why my avatar STOPS playing when I want it to display again in another frame?

Code: Select all

<frame>       
<!--FRM=Avatars-->
<frame posn="-36 26 0">
 <quad posn="0 0 -31" sizen="97 63.4" style="Bgs1" substyle="BgCardBuddy"></quad>
</frame>
<frame posn="0 -1 0">
<!--FRM=avatar1-->
<frame posn="-5.2 9 0">
<video posn="-26.7 13.7 -30" sizen="9.3 7.7" data="http://jonasmanialink.freeiz.com/avatars/media/giggity.bik" play="1"></video>
<quad posn="-27 14 -29" sizen="10 10" style="BgsChallengeMedals" substyle="BgSilver" manialink="http://jonasmanialink.freeiz.com/avatars/avatars_download_popup.xml"></quad>
<label posn="-22 5.3 -28" sizen="8 2" halign="center" valign="center" textsize="1" textcolor="000F" text="test"></label>
</frame>
When someone clicks on the quad this code executes:

Code: Select all

<!--FRM=download avatar-->
<frame posn="12 -8 0">
<quad posn="-48.1 34.1 -25" sizen="97.3 63.7" style="Bgs1" substyle="BgList"></quad>
<quad posn="-16 21 -24" sizen="32.6 31" style="Bgs1" substyle="BgTitlePage"></quad>
<quad posn="-14 -4 -23" sizen="28 4" style="Bgs1" substyle="BgTitle3_3" manialink="http://jonasmanialink.freeiz.com/avatars/avatars.xml"></quad>
<quad posn="-14 19 -23" sizen="28 4" style="Bgs1" substyle="BgTitle3_3"></quad>
<label posn="0.2 17.2 -22" sizen="15.8 2.7" halign="center" valign="center" textsize="3" text="$oYour text here"></label>
<label posn="0.2 -5.8 -22" sizen="6 3" halign="center" valign="center" textsize="3" text="$oClose"></label>
<label posn="2.4 1.5 -23" sizen="9.7 3" textsize="2" scale="1.1" text="$oDownload"></label>
<quad posn="3.9 12.6 -23" sizen="10 10" style="Icons128x128_1" substyle="Save"></quad>
<video posn="-12.6 11.8 -23" sizen="12.1 10.7" data="http://jonasmanialink.freeiz.com/avatars/media/giggity.bik" play="1"></video>
<quad posn="-13 12.4 -22" sizen="13 13.8" style="BgsChallengeMedals" substyle="BgSilver"></quad>
</frame>
and my avatar STOPS playing...

Re: loading a page within a frame problem

Posted: 19 Aug 2014, 13:45
by steeffeen
i'm the wrong to ask for that :D
but i guess it's not your fault because after all there is nothing special in your code ^^
maybe TMUF has some issues with displaying the same .bik two times (which works at other places so that's probably not it)