loading a page within a frame problem

Talk about ManiaLink development in this forum

Moderator: NADEO

jonasredant
Posts: 39
Joined: 10 Aug 2014, 17:26

loading a page within a frame problem

Post 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.
User avatar
Nerpson
Translator
Translator
Posts: 1554
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: loading a page within a frame problem

Post by Nerpson »

In php this would be simple.

Code: Select all

<?php include("file_url"); ?>
and it's done.
ImageImageImageImage
jonasredant
Posts: 39
Joined: 10 Aug 2014, 17:26

Re: loading a page within a frame problem

Post 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">
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: loading a page within a frame problem

Post 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
.
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
jonasredant
Posts: 39
Joined: 10 Aug 2014, 17:26

Re: loading a page within a frame problem

Post 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
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: loading a page within a frame problem

Post by steeffeen »

there is no support of dynamically replacing content in a manialink
you always have to load the whole page
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    jonasredant
    Posts: 39
    Joined: 10 Aug 2014, 17:26

    Re: loading a page within a frame problem

    Post 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?
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: loading a page within a frame problem

    Post by steeffeen »

    images are cached over long term while the xmls shouldn't be cached (i'm no expert in TMUF things though)
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      jonasredant
      Posts: 39
      Joined: 10 Aug 2014, 17:26

      Re: loading a page within a frame problem

      Post 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...
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: loading a page within a frame problem

      Post 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)
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        Post Reply

        Return to “ManiaLink”

        Who is online

        Users browsing this forum: No registered users and 2 guests