>>
Site Map
>>
Forums
>>
Blocks 6x
Forum module - topics in forum:
Blocks 6x - Discussions regarding PHP-Nuke Blocks.
Trying to create a block
Hi,
I'm trying to create a block that has HTML in it that simply launches a window to another web page when clicked but I am getting nowhere. The block does not even save properly. All I am doing is pasting he code below into a block.
I assume that this is the correct thing to do although the last time I did this, one of you kindly inserted it into a .php file for me and it worked. I tried that and no joy
Here is the code in the block -
Unfortunately I can't add the code because if I do, this message will not post
Thanks in anticipation.
Steve

Mail me the code buddy.... it should post unless it has javascript in it
Just to prove the point that php can be posted ok.
| Code: : |
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Sample_Block.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "Here goes the content you want in your new block";
?> |
You could also just put the html code in there...
| Code: : |
| <a href="http://www.whatever.com" target="_blank">Whatever text you want</a> |
Or if you want to use a picture then
| Code: : |
| <a href="http://www.whatever.com" target="_blank"><img src="http://wherever the image is.com"></a> |
2 good solutions by my colleges, has this been resolved?
Just another tip if you have an HTML editor like Dreamweaver or similar, just write in the text bit the text you wish to display then add the link and any graphics. Then click on the button that shows you the code of the page you are writing - on DW it's a button with <> on it. Highlight the code between <body> and </body> and press control C then in your php portal just click on Blocks, and where it asks you to create a block just give it a name in the title box and paste your code in the content box. When saved and viewed the text will become highlighted and when people click on it it is like any other hyperlink and will open that page!
Sorry it's a bit long winded but if you are unsure of HTML coding, it's the easiest way to start and you soon get to become familiar with different string lines as they are called. I have not yet had a problem importing direct HTML into phpNuke - but the clever bods on here will no doubt tell me otherwise! 
Sorry - I have been away a couple of days.
I will try these examples.
However, I think that you hit the nail on the head. The code that I was using had JavaScript in it that was intended to launch a page in a small browser window with no toolbars etc.,
Also, what I was doing was pasting my code into the block converter in the Nuke Tools section on this site.
I'll try this later and will for sure let you lnow that it works. I didn't want you to think that you were posting stuff here for me in vain.