Simple Machines Community Forum

General Community => Scripting Help => Topic started by: FrizzleFried on April 07, 2022, 08:38:05 AM

Title: Iframe Question
Post by: FrizzleFried on April 07, 2022, 08:38:05 AM
NOTE: I really have no idea what I am doing.  I am barely a hack trying to get things that I want accomplished my learning on the fly and asking questions as I go.  Expect me to know very little so please ... keep that in mind when replying.  I'm not even a novice...

Now to the question..

echo '<a href="' . $scripturl . '?action=ratings;sa=seeratings;msgid=' . $message['id'] . '" onclick="return reqWin(this.href, 600, 400, false);">' . '&nbsp;<img src="https://www.NOFOLLOW.com/apricons/gear.png">' . '</a><br><br>';
 }

Ok.  This code opens a "VIEW ALL RATINGS" pop-up.

I would much prefer this open up as a "frame" within the page... then be able to close" also within the page.  Ideally...once I can get the page to appear in a frame,  I would like to add some effects like a sliding open/close, etc... but just getting the darned thing to appear is my first step.

I do believe this is called an "iframe".   I'm also OK with this data appearing as a "hover" effect over that same ICON if it's easier.

Can someone give me an idea how how to change this from opening a pop up window (separate from main page) to an iframe,  other other such method of creating this frame within the page at click?

Thanks!

Title: Re: Iframe Question
Post by: Kindred on April 07, 2022, 10:28:03 AM
iframes are old tech and are generally not used much anymore.

However, what you describe is a modal box, not an iframe.
The problem with modals is that they have to be loaded at the same time that the page itself is loaded (the CODE is loaded but the visual is inactive until you do something). This means that the content loaded in the modal generally needs to be retrieved (and available) at page load.

Opening a pop-up is less code intensive and does not require it's content to be available until triggered.

in short, you're asking for something that may negatively impact your system.

You'd have to ask the author of the reactions mod for more details
Title: Re: Iframe Question
Post by: Diego Andrés on April 07, 2022, 12:46:47 PM
Kindred, the phrasing is a bit off but he's asking for that (the modal type of functionality).

Ideally, it needs just a few tweaks in the source file using $context['from_ajax'] = true;
Then, using the expected syntax for the sub-template, and replacing reqWin with reqOverlayDiv