TinyPortal

Development => Block Codes => Topic started by: Thurnok on August 09, 2006, 08:13:37 AM

Title: [Block] Custom Page
Post by: Thurnok on August 09, 2006, 08:13:37 AM
I originally posted this in response to another topic ("Block that members can mod (http://www.tinyportal.net/smf/index.php?topic=6556.0)") but realized it really doesn't fit the title.  Though the original poster, I believe, was actually looking for a custom page per user that could be displayed in a block so I responded there, mistakingly perhaps.  So, to call a duck a duck, I figured I would make a topic based on the actual code I posted and move my original posts here.
----- moved -----
Ok.. I did one up this morning.  I would have done yesterday but was at a party. (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.knightsofneee.com%2FSmileys%2Fother%2Fbeer.gif&hash=58752fefe49110f536a341589398e1eac402bee3)

The idea of having a profile entry for myspace was ok, but this would require manually adding it or the webmaster having to install the Custom Profile mod or something.  I'd prefer to not make a block snippet dependent on some mod being installed since not everyone will have or want to have some particular mod installed.  Therefore, this one does not require any mod being available.  You simply add your page in the form under the page itself.

First, here's the code (phpblock):
//////////////////////////////////////////////
// Custom Page 1.05
// Developed by Thurnok
// Complete Computer Services
// August 27, 2006
//
// Last updated - January 27, 2007
// - fix for PHP 5.x
//
// Custom Page allows you to give your users the ability to display
// a page of their choice in a centerblock or article based on their User ID.
// This project was developed due to a request on TinyPortal site for
// a centerblock that would display the currently logged in user's
// myspace site.
//
// This version allows your members to choose whether to allow other members
// to view their custom page or not.  Other members can use a pulldown to select
// a member that has their custom page set to public and hence view that member's page.
// It also updates your custompage table to accommodate this automatically.
//
// This script will create a table for the custom page using your current
// SMF table prefix followed by custompage (ex: smf_custompage) and using your
// current database credential information.
// NOTE: Your database user/permissions used for SMF must allow you to
// create a table or you will never be able to store the info.  You
// can create the table manually if necessary.
//
// Also note that a mysql connection is already alive and so creating a new connection
// and closing it is undesirable and causes problems in other blocks.  Therefore,
// you will notice the absence of mysql_connect() and mysql_close() functions
// used in this snippet.
//////////////////////////////////////////////

// User Configurable items

//   *****   LAYOUT OPTIONS   *****
// an IFRAME is necessary to keep the page "within" your site
// width and height of the IFRAME in your center block
$cp_width = "100%";
$cp_height = 600;

//   *****   SECURITY CONFIGURATION   *****
// Groups allowed to select and set their custom page
// This is in the form of their Group ID - example: array('3', '6', '9');
$cp_allowed_groups = array('');
// individual members not allowed to use even if in an allowed group
// uses the member ID - example: array('91', '16');
$cp_disallowed_members = array('');
// whether or not to allow users to make their site public
$cp_allow_public = true;

//   *****   DEFAULT STUFF   *****
// if the user is not allowed, or doesn't have a custom page yet, what
// page do you want to display to them in the IFRAME?
$cp_default_page = "http://www.google.com";

// whether to display the default page if not allowed or no page yet (set to a true value)
// or to not display any page in the block, only the form (set to a false value)
$cp_display_default = 1;

// if $cp_display_default = 0 (or some false value), and user doesn't have a page set,
// display this default text where the IFRAME would have been
$cp_default_text = "You currently do not have a custom page selected.<br />
Please use the form below to select a page.<br />
If you do not see the form below, it is because you do not have access to create a custom page.";

// you can set the tablename to other than custompage if you like
$cp_tablename = "custompage";
// and the title displayed
$cp_title = "Custom Page!";
// add some descriptive text here if you like to display under title
$cp_desc = "Your MySpace right here!  Use the form below to set your custom page.";

// if user's browser does not support IFRAMEs, display this where it would be
$cp_no_iframe = "<h1>Custom Page!</h1>
Your browser does not support IFRAMEs.  You should get a better browser to see what you are missing!<br />
Check out Mozilla or Firefox, they are great!<br />";


// Print our title - or comment the line to not display a title
echo '<center><b>' . $cp_title . '</b></center><br />';
echo '<font size=1>' . $cp_desc . '</font><p />';

//////////////////////////////////////////////
//
// The rest of this you should leave as is
// unless you are overly industrious :)
//
//////////////////////////////////////////////
// globals for database vars
global $db_prefix;
// globals for user information
global $context, $user_info, $ID_MEMBER;

$cp_id = $ID_MEMBER;
$cp_admin = false;

// set up all our functions ahead of time
// function to create table if not already there
function CustomPageCreateTable($cp_tablename) {
// set up the query that will create the table appropriately
$dbquery = "CREATE table $cp_tablename (id INT UNSIGNED NOT NULL PRIMARY KEY,
url TEXT, public tinyint(1) NOT NULL default '0', selected_user INT UNSIGNED);";
if (!mysql_query($dbquery)) {
die("Query Failed!  Table NOT Created!<br />\n");
}
}

// function to modify table to add "public" and "selected_user" columns
function CustomPageModifyTable($cp_tablename) {
// set up the query that will modify the table appropriately
$dbquery = "ALTER TABLE $cp_tablename ADD (public tinyint(1) NOT NULL default '0', selected_user INT UNSIGNED);";
if (!mysql_query($dbquery)) {
if (mysql_errno() == 1060){
// just a double precaution as part of the NULL fix :)
} else {
die("Query Failed!  Table NOT Modified!<br />\n" . mysql_errno() . ": " . mysql_error());
}
}
}

// function to add/edit a user and their custom page to/in the table
function CustomPageAdd($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public=0) {
if ($cp_url != ''){
if (strtolower(substr($cp_url, 0, 7)) != "http://"){
$cp_url = "http://" . $cp_url;
}
}
// only add user if they do not already exist
$dbquery = "SELECT * FROM $cp_tablename
WHERE id = '" . $cp_id . "'";
$dbresult = mysql_query($dbquery);
if ($dbresult){
if ($row = mysql_fetch_assoc($dbresult)){
// if a row is found, then there's already this user in table, edit instead
CustomPageEdit($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public);
return;
}
}
$dbquery = 'INSERT INTO '.$cp_tablename.' VALUES ('.$cp_id.', "'.$cp_url.'", '.$cp_public.', '.$cp_selected_user.');';
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Inserted into database!<br />\n");
}
}

// function to edit a user's custom page in the table
function CustomPageEdit($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public=0) {
// start our dbquery
$dbquery = "UPDATE $cp_tablename ";
// if no URL supplied, don't edit the URL
if ($cp_url != ''){
// add HTTP:// if necessary at front of link to prevent BASE URL applying in front of link provided
if (strtolower(substr($cp_url, 0, 7)) != "http://"){
$cp_url = "http://" . $cp_url;
}
// since an url was entered, add it to the update
$dbquery .= 'SET url = "'.$cp_url.'", public = '.$cp_public.', selected_user = '.$cp_selected_user.'
WHERE id = '.$cp_id.';';
} else {
// update all but the URL
$dbquery .= "SET public = $cp_public, selected_user = $cp_selected_user
WHERE id = $cp_id;";
}
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Modified in database!<br />\n");
}
}

// function to delete Custom Page from the table
function CustomPageDel($cp_tablename, $cp_selected_user) {
// delete Custom Page with $cp_id
$dbquery = "DELETE FROM $cp_tablename WHERE id = $cp_selected_user;";
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Deleted from database!<br />\n");
}
}


///////////  MAIN CODE HERE  ////////////
// Admins are always allowed to create a custom page
if ($context['user']['is_admin']){
$cp_admin = 1;
}

// convert $_POST vars to prevent undefined index errors
$cp_save = empty($_POST['cp_save']) ? '' : $_POST['cp_save'];
$cp_del = empty($_POST['cp_del']) ? '' : $_POST['cp_del'];
$cp_urlbox = empty($_POST['cp_urlbox']) ? '' : $_POST['cp_urlbox'];
$cp_public = empty($_POST['cp_public']) ? 0 : $_POST['cp_public'];
$cp_selected_user = empty($_POST['cp_selected_user']) || (!$cp_allow_public && !$cp_admin) ? $ID_MEMBER : $_POST['cp_selected_user'];

// get our script url including parameters (like ?page=6)
$myself = $_SERVER['REQUEST_URL'];

// put the SMF table prefix in front of your tablename from above
$cp_tablename = $db_prefix . $cp_tablename;
// do same for SMF Members table
$smf_members_table = $db_prefix . 'members';


////////////////   Security Checks  ////////////////
// check if user is in a group that is allowed to set a custom page
$cp_allowed = array_intersect($cp_allowed_groups, $user_info['groups']);

// don't let guests set page - would set default for all guests if they did
// also check if user is in the disallow array
if ($context['user']['is_guest'] || @in_array($ID_MEMBER, $cp_disallowed_members)){
$cp_allowed = false;
}

// Admins are always allowed to create a custom page
if ($cp_admin){
$cp_allowed = 1;
}
//////////////////////////////////////////////

// if someone just clicked Save, post info to database
if (!empty($cp_save) && $cp_allowed){
// if the urlbox had info in it, trim it
if (!empty($cp_urlbox)){
$cp_urlbox = trim($cp_urlbox);
} else {
$cp_urlbox = '';
}
CustomPageAdd($cp_tablename, $cp_id, $cp_urlbox, $cp_selected_user, $cp_public);
}

// if someone just deleted a page, remove it from database
if ($cp_del && $cp_admin){
CustomPageDel($cp_tablename, $cp_del);
}

////////////  MAIN DISPLAY CODE HERE  ///////////////
// set query to select all data for all users
$dbquery = "SELECT * FROM $cp_tablename;";
$dbresult = mysql_query($dbquery);

if ($dbresult){
// table exists - does it need an upate?
$row = mysql_fetch_assoc($dbresult);
if (in_array("public", array_keys($row))){
// no update needed here!
mysql_data_seek($dbresult, 0);
} else {
// YES!  then create the columns!
mysql_free_result($dbquery);
CustomPageModifyTable($cp_tablename);
// re-query the modified table
$dbresult = mysql_query($dbquery);
if (!$dbresult){
die("Unexpected error: " . mysql_error());
}
}
} else {
// no result, is it because table doesn't exist?
if (mysql_errno() == 1146){
// table doesn't exist, create it!
CustomPageCreateTable($cp_tablename);
// get our result again
$dbresult = mysql_query($dbquery);
if (!$dbresult) die("Unexpected error: " . mysql_error());
} else {
die("Unexpected error: " . mysql_error());
}
}

$cp_page = '';
$cp_selected_user = $ID_MEMBER;
$cp_selected_page = '';
// cycle through all rows
while ($row = mysql_fetch_assoc($dbresult)){
// add to public pages array if they have set to public (but not ourselves)
// or if the current user is an admin
if (($row["public"] != 0 || $cp_admin) && $row["id"] != $ID_MEMBER){
$cp_public_pages[$row["id"]] = $row["url"];
}
// if our row, get our public status, url, and our selected user
if ($row["id"] == $ID_MEMBER){
$cp_public = $row["public"];
$cp_page = $row["url"];
$cp_urlbox = $cp_page;
$cp_selected_user = $row["selected_user"];
}
}
$cp_public == 0 ? $cp_checked = '' : $cp_checked = "CHECKED";

// free previous result set
mysql_free_result($dbresult);
// if there were some public pages in table, setup the public users array
if (!empty($cp_public_pages)){
$dbquery = "SELECT ID_MEMBER, memberName FROM $smf_members_table
WHERE ID_MEMBER IN (" . implode(",", array_keys($cp_public_pages)) . ");";
$dbresult = mysql_query($dbquery);
if (!$dbresult) die("Unexpected error: " . mysql_error());
$cp_public_users = array();
while ($row = mysql_fetch_assoc($dbresult)){
$cp_public_users[$row["ID_MEMBER"]] = $row["memberName"];
}
// free the result for good measure
mysql_free_result($dbresult);
}

// get our selected user's page
if (!empty($cp_public_pages) && @in_array($cp_selected_user, @array_keys($cp_public_pages))){
$cp_selected_page = $cp_public_pages[$cp_selected_user];
}
// if the selected page is null "" then select our own page if it not ""
if (empty($cp_selected_page)){
if (!empty($cp_page)){
$cp_selected_page = $cp_page;
} else {
$cp_display_default ? $cp_selected_page = $cp_default_page : $cp_selected_page = '';
}
}

// display the $cp_selected_page to the user
if (!empty($cp_selected_page)){
echo '<center><IFRAME NAME="CustomPage" ALIGN=middle SRC="' . $cp_selected_page . '" WIDTH=' . $cp_width . ' HEIGHT=' . $cp_height . '>
' . $cp_no_iframe . '
</IFRAME></center>';
} else {
if ($cp_display_default){
echo '<center><IFRAME id="CustomPageID" NAME="CustomPage" ALIGN=middle SRC="' . $cp_default_page . '" WIDTH=' . $cp_width . ' HEIGHT=' . $cp_height . '>
' . $cp_no_iframe . '
</IFRAME></center>';
} else {
echo '<br />' . $cp_default_text . '<p />';
}
}

// only show form if user is allowed to add/edit their custom page
if ($cp_allowed){
//////////////////////////////////////////////////////////////////
/////////////           Javascript area              /////////////
//////////////////////////////////////////////////////////////////
// write out our javascript stuff

echo '
<script type="text/javascript">
<!--
// create our main array first
var jarray = new Array(); // list of member ids from pull down
var jarray2 = new Array(); // public page user ids
var jarray3 = new Array(); // public page urls
var jarray4 = new Array(); // array of public page user ids => public page urls
jarray[0] = '.$ID_MEMBER.';
jarray4['.$ID_MEMBER.'] = "'.$cp_page.'";
';
if (!empty($cp_public_pages)){
// create a list of public page user ids
$cp_public_user_list = implode(",", array_keys($cp_public_users));
$cp_page_ids = implode(",", array_keys($cp_public_pages));
foreach($cp_public_pages AS $key => $value){
if (empty($cp_page_urls)){
$cp_page_urls = '"' . $value . '"';
} else {
$cp_page_urls .= ',"' . $value . '"';
}
}
echo '
jarray.push('.$cp_public_user_list.');
// if our javascript is huge, big bandwidth waster, save some bandwidth here
jarray2.push('.$cp_page_ids.');
jarray3.push('.$cp_page_urls.');
y = jarray2.length;
for (x=0;x<y;x++){
page_id = jarray2[x];
jarray4[page_id] = jarray3[x];
}
';
}
echo '
function selectedChanged(){
s_id = jarray[document.cp_form.cp_selected_user.selectedIndex];
s_url = jarray4[s_id];
window.frames.CustomPage.location.href = s_url;
}
//-->
</script>
';


// start our form and table
echo '
<p /><form name="cp_form" action="' . $myself . '" method=post>
<table width="100%" border=0>
<tr>
<td width="40%">My Custom Page info:</td>
<td width="10%"></td>
<td width="40%">Public Member Pages</td>
<td width="10%"></td>
</tr>
<tr>
<td width="40%">URL: <input type=text name=cp_urlbox size="50" value="' . $cp_urlbox . '" /></td>
<td width="10%"></td>
<td width="40%" align="left">
<select name=cp_selected_user onChange="selectedChanged()">';
if ($cp_selected_user == $ID_MEMBER){
echo '
<option value="'.$ID_MEMBER.'" SELECTED>' . $user_info["username"] . '</option>
';
} else {
echo '
<option value="'.$ID_MEMBER.'">' . $user_info["username"] . '</option>
';
}
if (!empty($cp_public_users)){
foreach ($cp_public_users as $key => $value){
echo '

';
if ($cp_selected_user == $key){
echo '
<option value="'.$key.'" SELECTED>' . $value . '</option>
';
} else {
echo '
<option value="'.$key.'">' . $value . '</option>
';
}
}
}
echo '
</select>
</td>
<td width="10%"></td>
</tr>
<tr>
<td width="40%"><label><input type=checkbox name=cp_public value="1" ' . $cp_checked . ' />Make my page public</label></td>
<td width="10%"></td>
<td width="40%"></td>
<td width="10%"></td>
</tr>
<tr>
<td colspan="4" align="center"><input type=submit name=cp_save value="Save" /></td>
</tr>
</table>
</form>
';
}


See the next post for usage info and features.
Also, you can demo at my TP Blocks site: http://tpblocks.ccs-net.com (register to see both a "user" and "admin" perspective of various blocks).
Title: Re: Custom Page block
Post by: Thurnok on August 09, 2006, 08:15:45 AM
Custom Page

Features:
Configuration Items:
The rest is pretty self-explanitory and the code is moderately commented.

To Do's:
and of course any other suggestions here   :)
Title: Re: Custom Page block
Post by: Thurnok on August 09, 2006, 08:16:27 AM
Additional usage of Custom Page:

You can optionally put the code into a php Article.  The suggested usage in this case would be to give a menu item (My Custom Page for example) and let the user click the menu item to display/add/edit their custom page.

When creating the article, you must make a php article and simply put the same code above into it.  You should set the article to not display on the frontpage.  Then your users can click the Custom Page menu item you create to display the full body article (it of course being their custom page).  This in effect gives them a one click link to their custom page and allows you to make more of it visible (set the IFRAME width/height parameters larger) since you can set the article to not display left/right blocks, center blocks, etc.

Create your article in the admin control panel.  Then move your mouse over the article in the list and look at the link properties in your browser's status bar to see what page number the article is listed as.  Then create your menu item link using:
http://www.mysmfsite.com/index.php?page=<the page number you read>

That's pretty much it...
Title: Re: Custom Page block
Post by: Avinash on August 09, 2006, 11:22:23 PM
I like the sound of this, but the demo site is down :(
Title: Re: Custom Page block
Post by: Wartog on August 10, 2006, 04:08:55 AM
Very nice. however is thier anyway to resize the site shown in the block?
Title: Re: Custom Page block
Post by: Thurnok on August 10, 2006, 04:46:45 AM
Quote from: Avinash on August 09, 2006, 11:22:23 PM
I like the sound of this, but the demo site is down :(
There is no demo site.  The link there is an example of what you would put in a menu to call it from an article.
Title: Re: Custom Page block
Post by: Thurnok on August 10, 2006, 04:49:42 AM
You can resize the IFRAME as mentioned by changing the variables $cp_width and $cp_height.  I assume that is what you are asking.  If you are asking is there a way to zoom a website in and out of an IFRAME then the answer is not really.
Title: Re: Custom Page block
Post by: Wartog on August 10, 2006, 05:15:19 AM
I mean how to get the iframe to show the whole webpages width.
like it only show half the width and you have to scroll.

Id like to have it display the whole webpages width inside the iframe without the scroll .
Title: Re: Custom Page block
Post by: IchBin on August 10, 2006, 05:34:17 AM
is your width/height set to 100%?
Title: Re: Custom Page block
Post by: Thurnok on August 10, 2006, 05:40:31 AM
Change the variables I mentioned, that resizes the IFRAME (which is what creates the scroll bars).

Things to keep in mind:
1) If a website's page is using static sizing, and your IFRAME is using smaller dimensions than that of the page being loaded into, you will get scrollbars (assuming the defaults for IFRAME), or you will simply see only the amount of the page that fits the IFRAME size.  That's simply how IFRAME works.

2) You cannot zoom a webpage (a.k.a. scale it) to fit in the IFRAME.  At least not in pure HTML/PHP.  It would be a relatively complicated discussion to further explain it so just assume that it cannot be done in a practical manner for this venue.

3) IFRAME's size can be set static or relative.  In other words you can use 100% for width and height settings instead of a set number of pixels.  In the case of a TP Center block, width set to 100% works fine.  However, in the case of Height, the IFRAME will get the initial block height from TP which will be relatively small (same is true in an article) where as setting a static setting (an actual pixel size) will force the TP Block to expand to the size set.  In the Custom Page block, set $cp_width = "100%"; if you like.  Don't forget the double quotes however.

4) When using a static size for IFRAME's dimensions, keep in mind the resolutions of your members differ and therefore could cause them to have to scroll right to see right side blocks if you set width statically too high for their resolution.
Title: Re: Custom Page block
Post by: Thurnok on August 20, 2006, 03:48:00 AM
Some sites were not interpreting relative url ($myself) properly, so modified it for full url by added $boardurl info.  Code updated in original post.
Title: Re: Custom Page block
Post by: Avinash on August 20, 2006, 03:16:48 PM
It seems like Internet Explorer doest like the code. The page becomes stretched horizontally, and IE says "done loading with errors" at the bottom. :(
Title: Re: Custom Page block
Post by: Thurnok on August 20, 2006, 06:09:21 PM
hmm.. I tested in IE, Mozilla, Firefox.  Seems to work ok here.  Are you putting into a center block or an article?

Try changing the default width of the IFrame to something smaller.  Remember that static webpages larger in width than your IFrame will cause a scrollbar at the bottom and you won't see the whole width of the page without scrolling back and forth.  Also if you have the IFrame width set larger than your block/article's width it will stretch the block/article to fit.

The IFrame's width is set by changing the $cp_width variable.  I changed the default in the code to '100%' last time which should simply fill in the block it is contained within.  You can set it to a static number like 600 for example which would set it to 600 pixels. 
Title: Re: Custom Page block
Post by: Avinash on August 21, 2006, 01:27:33 AM
That's weird, all I did, was copy your default code into a php centre block and run it. I didn't modify anything. I will attach the screenshot to show what the problem in IE is. In addition, type my own URL into the box and hit 'Add' i get this error:

Not Found
The requested URL /smf/smf/index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

There should be some place in the code to get rid of the extra /smf/ but I don't see it after searching for smf in notepad.
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 05:31:49 AM
You might want to try copying the code again.  I'm not sure why you are getting the error.  Here's screenshots of IE and Mozilla both going to SMF directly and then within a custom page block (in an Article):

Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 05:55:41 AM
I did find one unusual occurance with the Add / Edit button.  I left out the closing button tag (</button>) which only seemed to display an issue in IE and only when in a Center block, not an Article.  It elongated the button.  No errors however, and the page still displayed.  I fixed that in the code now however for consistency sake.
Title: Re: Custom Page block
Post by: RoarinRow on August 21, 2006, 06:19:26 AM
Quote from: Thurnok on August 21, 2006, 05:55:41 AM
I did find one unusual occurance with the Add / Edit button.  I left out the closing button tag (</button>) which only seemed to display an issue in IE and only when in a Center block, not an Article.  It elongated the button.  No errors however, and the page still displayed.  I fixed that in the code now however for consistency sake.

Very cool mod for sure.  I tried to use the code on a Frontpage Block and Article and the Add button didn't do anything.  I'm on IE6.  In a Center Block the Add button was elongated for some reason. 

I'll try again on my other test site. . .
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 06:22:54 AM
Yep... the elongation was definately caused by the lack of the button closing tag.  Copy the code again from first post and it should be fixed.

When you say the Add button didn't do anything, do you mean you did not get the page displayed that you put into the My Page: editbox?
Title: Re: Custom Page block
Post by: RoarinRow on August 21, 2006, 07:02:27 AM
Quote from: Thurnok on August 21, 2006, 06:22:54 AM
Yep... the elongation was definately caused by the lack of the button closing tag.  Copy the code again from first post and it should be fixed.

When you say the Add button didn't do anything, do you mean you did not get the page displayed that you put into the My Page: editbox?

Correct, nothing happened when I click on 'Add', no other page appeared or no IE error message.   :o

You can see it on my test site - http://www.avalanchestyle-test.com/forum/index.php
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 07:17:01 AM
Ok... I found the problem.  This is what we call, fixing one problem and creating another ;)

When I modified for backward compatibility regarding HTTP REFERER I created the issue where if you put the code in an article that was not shown on the frontpage, you could not add a custom page because it reloaded index.php without your article showing (in otherwords, no page=<pagenum>).   So your non-frontpage article wasn't reloaded and hence the code to ADD was never executed.  heh

Ok, code updated.. give it a shot now.  :)
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 07:28:52 AM
Woops... sorry, missed that you were using IE.  I checked with IE and I see the button is not working.  Must be the <button> tag has a problem with IE.  Checking it now.
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 08:02:21 AM
Ok Roarin... I've got it fixed for you this time.

I used the <button> tag originally because I planned to use its extra features but ended up never using so changed it to a simple <input> tag.  IE is now all happy go funky.

Try it out and see if it resolves your issue.  :)
Title: Re: Custom Page block
Post by: RoarinRow on August 21, 2006, 02:49:53 PM
Quote from: Thurnok on August 21, 2006, 07:17:01 AM
Ok... I found the problem.  This is what we call, fixing one problem and creating another ;)

When I modified for backward compatibility regarding HTTP REFERER I created the issue where if you put the code in an article that was not shown on the frontpage, you could not add a custom page because it reloaded index.php without your article showing (in otherwords, no page=<pagenum>).   So your non-frontpage article wasn't reloaded and hence the code to ADD was never executed.  heh

Ok, code updated.. give it a shot now.  :)

When I type in http://www.yahoo.com and click on the 'Add' button, I get this error:

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

--------------------------------------------------------------------------------

Please try the following:

If you typed the page address in the Address bar, make sure that it is spelled correctly.

Open the www.avalanchestyle-test.com home page, and then look for links to the information you want.
Click the  Back button to try another link.
Click  Search to look for information on the Internet.



HTTP 404 - File not found
Internet Explorer

::)  At least it doing something this time, thanks. 
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 06:44:53 PM
Did it create an entry in your database?
Clear your forum errors via the SMF control panel, then try it again and see what errors are listed in your forum errors log.

Do you have a test ID I can use on your site to take a look?  One that you assigned to a member group with the Add privilege in the custom page block of course. hehe
Title: Re: Custom Page block
Post by: RoarinRow on August 21, 2006, 07:14:49 PM
Quote from: Thurnok on August 21, 2006, 06:44:53 PM
Did it create an entry in your database?
Clear your forum errors via the SMF control panel, then try it again and see what errors are listed in your forum errors log.

Do you have a test ID I can use on your site to take a look?  One that you assigned to a member group with the Add privilege in the custom page block of course. hehe

Yes it did create an entry in the database.

You can use as a test:

User ID - Codetest
Password - codetest

http://www.avalanchestyle-test.com/forum/index.php
Title: Re: Custom Page block
Post by: Thurnok on August 21, 2006, 10:50:56 PM
Ok... new code in first post.  This should fix "finally" the issue for those with their forums not in the root of their domain (http://www.mydomain.com/forum/index.php).

This one should work for everyone finally.  heh

Sorry for the delay... test it out and let me know.  :)

NOTE: Caveat in IE - you must click the button, not press enter, after entering the URL.  Might be OK on some IE versions however.
Title: Re: Custom Page block
Post by: RoarinRow on August 21, 2006, 10:57:47 PM
Ahhh, that worked!   :up: 8)
Title: Re: Custom Page block
Post by: londonhogfan on August 24, 2006, 03:37:16 PM
great work.  I like it.  Do you know of a way that they can publicly show their page?  would maybe be a small mod for tp... url of something like .com/index.php?mypage=[usernumber]

that way they could add a myspace page, or whatever they wanted within your site.

actually there is probably a way to integrate this into the "Profile Summary" page. hum...
Title: Re: Custom Page block
Post by: Thurnok on August 27, 2006, 05:34:39 AM
Sorry for the late reply, I'm on vacation and have my nephew and neice in town.

Well, to add it to their profile summary is one way.  Though that would make it a mod instead of a simple block snippet.  I'm not opposed to doing that, but I like the idea of putting anything possible in a snippet for a number of reasons.  The most important one being that it is easier for the site owner to integrate since they do not have to perform a mod manually, or install a package which may or may not have implications to their site when they upgrade SMF and/or TP in the future.

However, just thinking about the code to perform what you are looking for, I can say that it would be a simple matter for me to add it to the existing snippet.  I probably will have time tonight to do that, so look for it here later.
Title: Re: Custom Page block
Post by: Thurnok on August 27, 2006, 01:13:55 PM
Custom Page 1.0
A TinyPortal phpblock snippet
This is a new version of the Custom Page block code.

New Features:
Automatically updates previous Custom Page table as necessary.  Creates table for new installs.

New Variables in configuration:
$cp_allow_public - set to true to enable public user custom pages.

Get the code from the original post in this thread along with original information.
Title: Re: Custom Page block
Post by: RoarinRow on August 27, 2006, 04:38:47 PM
Very cool, I like the new feature  :up:

I just have these errors:

2: mysql_free_result(): 35 is not a valid MySQL result resource
File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 354

2: Invalid argument supplied for foreach()
File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 345

8: Undefined variable: cp_public_users
File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 345

8: Undefined variable: cp_public_pages
File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 302

8: Undefined variable: cp_public_pages
File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 290
Title: Re: Custom Page block
Post by: Jpg on August 27, 2006, 04:40:44 PM
O_O'

Ummm....I suggest get rid of it.
Title: Re: Custom Page block
Post by: RoarinRow on August 27, 2006, 04:44:24 PM
Quote from: Jpg on August 27, 2006, 04:40:44 PM
O_O'

Ummm....I suggest get rid of it.


I reverted back to original code for now  :up:
Title: Re: Custom Page block
Post by: Jpg on August 27, 2006, 04:45:52 PM
Good idea, since it was giving you that many errors. :\
Title: Re: Custom Page block
Post by: RoarinRow on August 27, 2006, 04:49:50 PM
Quote from: Jpg on August 27, 2006, 04:45:52 PM
Good idea, since it was giving you that many errors. :\

That's o.k. it wasn't life threatening   :o   ;D
Title: Re: Custom Page block
Post by: Thurnok on August 27, 2006, 10:41:16 PM
Yes.. those were all minor warnings.  All of them were a result of you not having any current public pages yet.  It was a late nite. ;)

I have fixed all of those.  Give it another shot.  Don't forget to set $cp_allow_public = true; if you want your users to be able to set their page as public and to be able to view other users pages.  Also, don't forget to set the user groups you want able to create their own public page ($cp_allowed_groups).

Additionally, added ability for an Admin to see all pages, public or not.  New code in original post.
Title: Re: Custom Page block
Post by: RoarinRow on August 27, 2006, 11:02:17 PM
I get this when I pull up the article with the new code:

Query Failed! Table NOT Modified!
Title: Re: Custom Page block
Post by: Thurnok on August 27, 2006, 11:09:58 PM
Might have been when you reverted back to the old version.  That version only had 2 columns where the new version has 4.  Sounds like one of the columns may have been left behind.

Go into your phpMyAdmin and drop the "public" and "selected_user" columns from the custompage table and then open the custom page block again.  It should then convert the table by adding the two extra columns.
Title: Re: Custom Page block
Post by: RoarinRow on August 28, 2006, 12:11:55 AM
Quote from: Thurnok on August 27, 2006, 11:09:58 PM
Might have been when you reverted back to the old version.  That version only had 2 columns where the new version has 4.  Sounds like one of the columns may have been left behind.

Go into your phpMyAdmin and drop the "public" and "selected_user" columns from the custompage table and then open the custom page block again.  It should then convert the table by adding the two extra columns.

Sweet, that worked!   :up:
Title: Re: Custom Page block
Post by: akulion on August 29, 2006, 12:22:32 PM
added to block snippets index
Title: Re: Custom Page block
Post by: Thurnok on September 12, 2006, 07:15:36 AM
Can't believe I missed this.  Oh well, over-looked it somehow when I added the allow public features.

If you tried this block for the first time after I added the feature to allow a member to make their page public to other users, and you couldn't get it to work (getting table not modified errors) then I fixed it.  New code in first post.

Sorry.   :uglystupid2:
Title: Re: Custom Page block
Post by: RoarinRow on September 12, 2006, 06:59:52 PM
Quote from: Thurnok on September 12, 2006, 07:15:36 AM
Can't believe I missed this.  Oh well, over-looked it somehow when I added the allow public features.

If you tried this block for the first time after I added the feature to allow a member to make their page public to other users, and you couldn't get it to work (getting table not modified errors) then I fixed it.  New code in first post.

Sorry.   :uglystupid2:

I tried the new code and got this error:

2: mysql_data_seek() [<a href='function.mysql-data-seek'>function.mysql-data-seek</a>]: Offset 0 is invalid for MySQL result index 38 (or the query data is unbuffered)

File: /home/avalanch/public_html/forum/Themes/default/TPortal.template.php (main sub template - eval?)
Line: 274

What does this mean?   :o
Title: Re: Custom Page block
Post by: Thurnok on September 13, 2006, 03:48:59 AM
Ok... think I found the problem... changed the technique for determining a table "upgrade" necessity.  Try that one.
Title: Re: Custom Page block
Post by: RoarinRow on September 13, 2006, 03:27:59 PM
Quote from: Thurnok on September 13, 2006, 03:48:59 AM
Ok... think I found the problem... changed the technique for determining a table "upgrade" necessity.  Try that one.

Looks like that worked, thanks!
Title: Re: Custom Page block
Post by: Thurnok on September 15, 2006, 12:13:11 AM
Ok... I enhanced this version with some javascript.  Now, when you select another member's "public" page from the dropdown, it is immediately displayed in the iframe.

If you click Save, the currently selected user will be saved to your profile so that their page is displayed until you select a different user's page to display as your custom page.  Your actual custom page's URL is unchanged unless you change it in the URL box and save.

Code is in the first post!
Title: Re: Custom Page block
Post by: RoarinRow on September 15, 2006, 12:35:19 AM
Very cool, it keeps getting better and better   :up:
Title: Re: Custom Page block
Post by: Thurnok on September 16, 2006, 08:51:40 PM
Well, this one is the one I should have actually released to start with, just I was rushing and slapped it together originally.

Now I need to do the same with the Linkit block, and put out what I should have to start with. ;)
Title: Re: Custom Page block
Post by: RoarinRow on September 17, 2006, 02:14:39 AM
Quote from: Thurnok on September 16, 2006, 08:51:40 PM
Well, this one is the one I should have actually released to start with, just I was rushing and slapped it together originally.

Now I need to do the same with the Linkit block, and put out what I should have to start with. ;)

No problem, it was cool just to see the snippet in action.   :up:
Title: Re: Custom Page block
Post by: Thurnok on September 18, 2006, 07:48:57 AM
Woops.. quick fix - had a mysql_error() where it should have been mysql_errno().   ::)
First post has code.
Title: Re: Custom Page block
Post by: RoarinRow on September 18, 2006, 08:06:38 AM
Quote from: Thurnok on September 18, 2006, 07:48:57 AM
Woops.. quick fix - had a mysql_error() where it should have been mysql_errno().   ::)
First post has code.

I tried the new code and when I chose another person's page it doesn't load and I get this IE error.   :o   Before I just used the drop down menu to pick a user's name and their page would load automatically, now when I chose the user's name I have to click the Save button to see their page and I get the IE error.
Title: Re: Custom Page block
Post by: Thurnok on September 18, 2006, 08:59:48 AM
Scratching my head on that...

I only changed this:
if (mysql_error() == 1060){

to this:
if (mysql_errno() == 1060){

It was part of the CustomPageModifyTable() function and was an added check in case you had the table but no entries yet.  It would have actually failed had there been no data because mysql_error() returns a text error message, where mysql_errno() returns an error number (integer) which is what I'm doing a compare against (1060).

There shouldn't be any way for it to produce what you got from that change.  Hmm.. maybe try copy/paste again in case of missing something... I repasted into original post... try copy/paste again to your block
Title: Re: Custom Page block
Post by: RoarinRow on September 18, 2006, 03:02:55 PM
Quote from: Thurnok on September 18, 2006, 08:59:48 AM
Scratching my head on that...

I only changed this:
if (mysql_error() == 1060){

to this:
if (mysql_errno() == 1060){

It was part of the CustomPageModifyTable() function and was an added check in case you had the table but no entries yet.  It would have actually failed had there been no data because mysql_error() returns a text error message, where mysql_errno() returns an error number (integer) which is what I'm doing a compare against (1060).

There shouldn't be any way for it to produce what you got from that change.  Hmm.. maybe try copy/paste again in case of missing something... I repasted into original post... try copy/paste again to your block

Very strange.  Is there anything I could check in that table?
Title: Re: Custom Page block
Post by: Thurnok on September 19, 2006, 12:12:10 AM
Hmm.. well, you already had the table updated I'm assuming, because you had the previous version with Javascript in it.  So, you really shouldn't even be hitting that function because it should already detect your table has the appropriate columns.  Unless you manually changed your table.

You can verify that by finding that portion of the code in the block and put this right above it temporarily:
echo 'TESTING<br />';

Then see if you see TESTING in your block after you refresh the page.  You should not see it at all.  That will tell you that you never even get to that part.

Not really sure what the error you got means.  Set me up a temp account if you like so I can check it direct on your site.  I put the new code in 3 of my test sites and seems to work properly.  I'll check again when I get home from work today.
Title: Re: Custom Page block
Post by: RoarinRow on September 19, 2006, 12:24:38 AM
Thanks, I PM'd you the info.   :up:
Title: Re: Custom Page block
Post by: Thurnok on September 19, 2006, 06:12:13 AM
LOL.. ok, I really don't know how that happened - other than I am still on drugs and it was quite late when I updated it - but somehow old --old-- test code got put in there and I even updated that old test code with the single fix I mentioned above.  LOL

Ok.. I have replaced it with the code from the correct file this time.   :2funny:
Title: Re: Custom Page block
Post by: RoarinRow on September 19, 2006, 06:21:29 AM
Quote from: Thurnok on September 19, 2006, 06:12:13 AM
LOL.. ok, I really don't know how that happened - other than I am still on drugs and it was quite late when I updated it - but somehow old --old-- test code got put in there and I even updated that old test code with the single fix I mentioned above.  LOL

Ok.. I have replaced it with the code from the correct file this time.   :2funny:

Awesome that did it!   :D   Thank you!
Title: Re: Custom Page block
Post by: Thurnok on September 25, 2006, 08:26:34 AM
If you want to try this TP Block out, without having to install it to your own site, go check it out at my TP Blocks site: http://tpblocks.ccs-net.com

Some things you can see as a guest, some you need to register on the site to see in action.  Also, if you register on the site you will be able to access some of the Blocks in both a "user" mode and an "admin" mode so you can see both perspectives.
Title: Re: Custom Page block
Post by: Ken. on January 21, 2007, 04:56:04 PM
I had made a post previously at this link (http://www.tinyportal.net/index.php?topic=12551.0) posing a question on how to take parts of two different code snippets and make them into one new one. The post didnââ,¬â,,¢t get very much traffic and in retrospect I do realize that the question should have been in this thread from the beginning.

My apologies for double posting, please delete the other topic if it poses a problemââ,¬Â¦ and, sorry for being so long winded in the question.

So, the question:
Iââ,¬â,,¢m using this Custom Page code by Thurnok on both of my forums and think that itââ,¬â,,¢s greatââ,¬Â¦ and it seems to be off to a good start as some of my members are starting to implement their own pages, all of them MySpace pages so far.
There is only one single issue that I have with the code and thatââ,¬â,,¢s the vertical/height scroll bars that occur when the page goes beyond the value that youââ,¬â,,¢ve set for it.
Thurnok mentioned in reply #9 (http://www.tinyportal.net/index.php?topic=7159.msg59382#msg59382) of this thread that you basically are not able to do an auto-resize on the pages that are pulled into the iframe (if Iââ,¬â,,¢m reading his post correctly), but thatââ,¬â,,¢s  what I want to doââ,¬Â¦ almost. :)

What I actually want to do is auto-resize the frame itself.
The code posted here (http://www.tinyportal.net/index.php?topic=11744.msg97181#msg97181) by G6 auto-resizes the iframe to fit the content being pulled in and it works just as expected, she posted it as a solution for getting cpg to fit the iframe window correctly, but I use it for lots of articles pulling in other pages that are on my regular website and based on HTML and it works great on all of them.
Iââ,¬â,,¢m trying to combine the iframe resize feature from the code by G6 into the Custom Page code by Thurnok, but my coding skills are falling a little shortââ,¬Â¦ can anyone take a look to see how it can be written in?
Thanksââ,¬Â¦ Ken

Ps: If you wish to see the iframe resize in action go to My Gallery (http://www.mykimbrell.com/FamilyForum/index.php?page=45) and open the album "Jake's Pics", that album only has one photo and you will see the iframe follows the size of the inserted page very well.
And, here's an HTML page from my regular site with a series of 4 pages that can be pulled in: Jason & Mary (http://www.mykimbrell.com/FamilyForum/index.php?page=53)

Title: Re: Custom Page block
Post by: Thurnok on January 22, 2007, 02:59:14 AM
Sorry... guess I missed your original post.  I'll take a look into this as soon as I can though.
Title: Re: Custom Page block
Post by: Ken. on January 22, 2007, 03:29:34 AM
Thanks Thurnok!
The code here on TP seems to get better and better all the while! ;D


Of course it helps that I'll actually begining to understand a little of it.  ;)
Title: Re: [Block] Custom Page
Post by: keith021773 on January 26, 2007, 02:06:31 PM
Hey all..    I just recently upgraded to PHP5.   Don't know if that has caused this, but it's the only thing that I can remember that I have changed..   

Here is the error I am getting.

Parse error: syntax error, unexpected T_VARIABLE in /home/.mariska/keith021773/daddyplace.com/Sources/Load.php(1753) : eval()'d code(231) : eval()'d code on line 139
Title: Re: [Block] Custom Page
Post by: IchBin on January 26, 2007, 04:38:23 PM
And you're getting this error because of this block code?
Title: Re: [Block] Custom Page
Post by: keith021773 on January 26, 2007, 04:46:35 PM
not exactly for sure..    it worked fine before I went to PHP5 from PHP4..   Just checked this morning and was getting this error when I clicked on custom page..
Title: Re: [Block] Custom Page
Post by: IchBin on January 26, 2007, 05:13:23 PM
I'd suggest checking the contents of your code. Make sure you haven't lost some code bit by comparing it to the original code. Try a whole new code block if you need to.
Title: Re: [Block] Custom Page
Post by: keith021773 on January 26, 2007, 05:18:20 PM
yeah..   When I first noticed it I searched for this thread and recopied all of the code and deleted the old code..  Same error.    Interesting, isn't it?   LOL
Title: Re: [Block] Custom Page
Post by: Thurnok on January 26, 2007, 11:07:02 PM
Was the line number the same when you got the error again after recopying the code?

When did you first put the Custom Page block on your site?  Because there have been changes as recent as 5 days ago, and definately should have been a different line number if your original code was older than Jan 21st.  If that is the case, it is probably something else that displays on the same page.

Current code for Custom Page should not have that error at that line number unless you do not have a good copy of the code.  That type of error is usually indicative of a missing semi-colon ( ; ) or brace ( } ) missing somewhere above the error line.  This would be irrespective of the version of php you have, however.
Title: Re: [Block] Custom Page
Post by: keith021773 on January 26, 2007, 11:18:09 PM
Just today I copied and pasted your code from the first of this thread.    I will do it again just to make sure.
Title: Re: [Block] Custom Page
Post by: keith021773 on January 26, 2007, 11:21:50 PM
Update...     Just recopied the code again and the same error message..      I honestly don't know what it could be..    But I sincerely appreciate you guys in helping me.
Title: Re: [Block] Custom Page
Post by: Thurnok on January 27, 2007, 12:51:31 AM
Ok, but you didn't quite answer my question.  You state "it worked fine before..."  My question is, how long ago did you originally put in the Custom Page code?  And, "before" you recopied the code in again the first time, was the line number in the error msg the same or not?

If you had a previous version, and the line number was 139, and you just put in the current version and the error is the same line number, it is most likely something else.  Code above that line has been added, and therefore, "if" you had a previous version originally, it almost assuredly would have changed line numbers when you "went to the first post and recopied the code" if it were an issue in the Custom Page block.

Where did you place the Custom Page code?  Article, Centerblock, etc.?  What else (blocks/articles) display on the same page as the Custom Page block?  If you simply disable the Custom Page block, does the error go away?
Title: Re: [Block] Custom Page
Post by: keith021773 on January 27, 2007, 01:10:34 AM
I'm not saying it's the code for the custom block at all.   Please don't get me wrong.....

The orginal code worked for mths, no problem at all.     I was just asking if going from PHP4 to PHP5 could give this type of error..   I plan on going back to php4 to see if it starts working again.
Title: Re: [Block] Custom Page
Post by: Thurnok on January 27, 2007, 01:28:20 AM
Ok, but I'm still trying to isolate your problem, regardless of what is causing it.  When you stated you got the error when going to the Custom Page, I'm assuming it happens only when the Custom Page block is visible.  Is this or is this not the case?

If you simply disable the Custom Page block, and then in turn, other blocks that display on the same page, you can narrow down where the issue is originating from.
Title: Re: [Block] Custom Page
Post by: keith021773 on January 27, 2007, 04:54:05 AM
Ok..   The custom page is an article that displays on it's own page..   There are no left, right, or center blocks there..  Just the custom page article. 

The error only displays when you go to the custom page.    Here is a pic.

Title: Re: [Block] Custom Page
Post by: Thurnok on January 27, 2007, 07:43:09 AM
Well, as the error in question is typical of the things I mentioned previously, you should be looking for a missed semi-colon or curly brace.  If you want, you can set up a temporary admin ID/Password and PM them to me and I can take a look at the block for you.
Title: Re: [Block] Custom Page
Post by: keith021773 on January 27, 2007, 02:25:39 PM
that would be great Thurnok.   I will PM you now.
Title: Re: [Block] Custom Page
Post by: Thurnok on January 27, 2007, 07:57:10 PM
Apparently an issue with PHP 5 - with backslash denoting literals.  Original post has fix in it.  For anyone else who had problems with this block and PHP 5.x, try the new code to see if it resolves your issue.
Title: Re: [Block] Custom Page
Post by: whatever on February 24, 2007, 11:01:57 AM
Many thanks for this! It works perfectly for me.

A suggestion:
It is possible to set an iframe to adjust size automatically. I use this for my coppermine gallery in TP:
IFrame SSI script II- Ã,© Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
Title: Re: [Block] Custom Page
Post by: MinasC on February 27, 2007, 11:23:37 AM
great code man !!! i used it in a phpblock and looks perfect !!! could it be that the selected page would be shown whole as a thumbnail or a preview ?? it could be clickable i guess , set to open in a new window when clicked !!! how about that idea ??
Title: Re: [Block] Custom Page
Post by: Thurnok on March 20, 2007, 05:36:25 AM
Didn't want you to think I disregarded you "whatever" and "MinasC".  I'll look into both these things when I have time.  I've been pretty tied up lately with work, and house maintenance things.
Title: Re: [Block] Custom Page
Post by: MinasC on March 22, 2007, 09:00:33 AM
ok man , i'm looking forward to your answer , cause i could really use this for a number of things !!! thnx
Title: Re: [Block] Custom Page
Post by: MinasC on June 19, 2007, 08:31:40 AM
Quote from: MinasC on February 27, 2007, 11:23:37 AM
great code man !!! i used it in a phpblock and looks perfect !!! could it be that the selected page would be shown whole as a thumbnail or a preview ?? it could be clickable i guess , set to open in a new window when clicked !!! how about that idea ??

hey there again !

Thurnok i don't mean to press you , just remind you . is there anything new about that ?

thnx again .
Title: Re: [Block] Custom Page
Post by: IchBin on June 19, 2007, 02:32:56 PM
Thurnok may or may not be able to respond ATM, so I'll give you a heads up. He is coming to an end of some big projects for work and stuff. We're hoping to see him within the next couple of weeks to make a return. Until then, patience is probably required. :)
Title: Re: [Block] Custom Page
Post by: MinasC on June 21, 2007, 10:20:20 AM
ok , thnx a lot for letting me know ! :)
Title: Re: [Block] Custom Page
Post by: gundamzero on July 30, 2007, 09:01:00 PM
This hack/block combo is great and works fine for me.  One of my members used this URL and it went full screen instead of staying within the article block.   http://www.tv-links.co.uk/index.do
Could it be code in the url causing that?
Title: Re: [Block] Custom Page
Post by: Thurnok on August 01, 2007, 07:15:34 AM
Absolutely.  Overwriting the current document window can be done.  Many times, website developers will intentionally do so to keep their sites from being "contained" within a "box".  Some scrupulous sites also sometimes use this for mischievous behaviour as well.