Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Common Installation Error FIXED!
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • September 20, 2019, 01:17:45 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Common Installation Error FIXED!  (Read 25394 times)
0 Members and 1 Guest are viewing this topic.
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« on: November 01, 2013, 07:49:02 AM »

Many new admins come across the issue of the installer sending them to a different page that "doesn't exist" when they're at Stage 2 of the Installer, moving onto Stage 3.

This has an easy find-and-replace fix. Before you install your game..

In lib/installer/installer_stage_1.php:

Find:

Code:
<?php
rawoutput
("<div style='width: 100%; height; 350px; max-height: 350px; overflow: auto; color: #FFFFFF; background-color: #000000; padding: 10px;'>");
rawoutput("<base href='http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode'>");
rawoutput("<base target='_blank'>");
rawoutput($license);
rawoutput("</div>");
rawoutput("<base href='http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."'>");
rawoutput("<base target='_self'>");

Replace With:

Code:
<?php
$cdomain 
"http://creativecommons.org";
$license preg_replace("/(href|src)\=\"([^(http)])(\/)?/""$1=\"".$cdomain."$2"$license);
rawoutput("<div style='width: 100%; height; 350px; max-height: 350px; overflow: auto; color: #FFFFFF; background-color: #000000; padding: 10px;'>".$license."</div>");

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

For the more HTML-savvy, you can only have ONE <base> tag in a page. The first one specifies a default URL for all links and sources on a page. This is initially the Creative Commons website URL.

The second <base> tag is meant to set the default URL back to your website's URL, but since you can only have one of these tags per page, it's cancelled out, and all links and sources are kept as the Creative Common's URL.

(You'll also notice this happens to other things - PayPal images and "Some Rights Reserved" images in the footer disappear, and all links (including the other stages) send you to the Creative Common's website. This is because their default URL is also Creative Common's URL.)

This fix removes the need of <base> tags at all, and instead, replaces all relative links and sources (e.g. images/thisimage.png) in the license code with absolute links and sources (e.g. http://creativecommon.org/images/thisimage.png).
« Last Edit: November 01, 2013, 10:13:35 AM by The Doctor » Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
70 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search