SimplePortal

Customization => Custom Coding => Topic started by: Yngwiedis on July 20, 2011, 08:59:53 AM

Title: I need some help with a custom block
Post by: Yngwiedis on July 20, 2011, 08:59:53 AM
Hello...

I have a site which is related to my web radio station
and i have that block with a flash shoutcast player and some other info:

Code: [Select]
require ("./radio/script/lang.php");
require ("./radio/script/config.php");
require ("./radio/script/players.php");
if ($streamstatus == "1") {
// On-line
    echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">Εβδομαδιαίο Πρόγραμμα Ραδιοφωνικού Σταθμού</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['now_playing'] . ': </b>' . $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>Έχετε Skype;<br />Μιλήστε ζωντανά με τον παραγωγό και κάντε φωνητικές αφιερώσεις κάνοντας click στο παρακάτω εικονίδιο!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

';
  }



Everything is ok but i get these errors in my error log:

Quote
8: Undefined index: id
Apply Filter: Only show the errors from this file
File: /home/vinilio/public_html/Sources/PortalBlocks.php
Line: 2360

8: Undefined index: title
Apply Filter: Only show the errors from this file
File: /home/vinilio/public_html/Themes/default/languages/SearchFocus.greek-utf8.php (body_above sub template - eval?)
Line: 470

8: Undefined index: href
Apply Filter: Only show the errors from this file
File: /home/vinilio/public_html/Themes/default/languages/SearchFocus.greek-utf8.php (body_above sub template - eval?)
Line: 469


Is there anything i can do to fix these errors ?

Thank you very very much for any help
Title: Re: I need some help with a custom block
Post by: Blue on July 20, 2011, 10:12:25 AM
Don't know if it will work but try this:

Code: [Select]
require ("./radio/script/lang.php");
require ("./radio/script/config.php");
require ("./radio/script/players.php");
if (isset($streamstatus)) {
// On-line
    echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">Εβδομαδιαίο Πρόγραμμα Ραδιοφωνικού Σταθμού</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['now_playing'] . ': </b>' . $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>Έχετε Skype;<br />Μιλήστε ζωντανά με τον παραγωγό και κάντε φωνητικές αφιερώσεις κάνοντας click στο παρακάτω εικονίδιο!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

';
  }

Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 20, 2011, 10:26:05 AM
I think is working...

Can you please tell me what are the changes so i will learn something ?

Thank you very very much.


EDIT: Also if its easy for you can you tell me how to put this code in the beggining of the same block ?
I have it in HTML and i dont know how to put it in a PHP block.

Code: [Select]
<script type='text/javascript'>
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,sc rollbars=No,resizable=No,status=No,width=700,heigh t=500,left=150,top=150,");
}
//-->
</script>

<div style="text-align: center;">
<a href="javascript:void(0);" onclick="javascript:Start ('http://mydomain.com/chat/flashchat.php');">FlashChat</a>
</div>

Thank you again...
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 20, 2011, 10:40:02 AM
Sorry but i am still getting errors :(

Quote
8: Undefined index: id
File: /home/vinilio/public_html/Sources/PortalBlocks.php
Line: 2360

8: Undefined index: title
File: /home/vinilio/public_html/Themes/default/languages/SearchFocus.greek-utf8.php (body_above sub template - eval?)
Line: 470

8: Undefined index: href
File: /home/vinilio/public_html/Themes/default/languages/SearchFocus.greek-utf8.php (body_above sub template - eval?)
Line: 469
Title: Re: I need some help with a custom block
Post by: Blue on July 20, 2011, 03:15:15 PM
Try this then:

Code: [Select]
<?php

//Remove Notice Errors
error_reporting(E_ALL E_NOTICE); 

//HTML Block Code
echo '
<script type="text/javascript">
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,sc rollbars=No,resizable=No,status=No,width=700,heigh t=500,left=150,top=150,");
}
//-->
</script>

<div style="text-align: center;">
<a href="javascript:void(0);" onclick="javascript:Start ("http://mydomain.com/chat/flashchat.php");">FlashChat</a>
</div>'
;

//Second Code
require ("./radio/script/lang.php");
require (
"./radio/script/config.php");
require (
"./radio/script/players.php");
if (isset(
$streamstatus)) {
// On-line
    
echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">?ßd?µad?a?? ?????aµµa ?ad??f?????? Sta?µ??</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['now_playing'] . ': </b>' $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>??ete Skype;<br />????ste ???ta?? µe t?? pa?a???? ?a? ???te f???t???? af?e??se?? ?????ta? click st? pa?a??t? e?????d??!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

'
;
  }


?>
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 21, 2011, 10:35:58 AM
Hmmmm...
Is not working...

Something is wrong...

I give again both codes.

HTML Block:

Code: [Select]
<script type='text/javascript'>
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,sc rollbars=No,resizable=No,status=No,width=700,heigh t=500,left=150,top=150,");
}
//-->
</script>

<div style="text-align: center;">
<b><a href="javascript:void(0);" onclick="javascript:Start ('http://www.vinilio.com/chat/flashchat.php');">Σύνδεση Στο Chat</a></b>
</div>

<hr />
<center><iframe frameborder="0" height="100" width="160" src="http://www.vinilio.com/chat/info_embedded.php" style="width: 140; margin: 0; padding: 0; border: 0;" scrolling="auto" border="0" allowtransparency="true"></iframe></center>

and the PHP Block:

Code: [Select]
require ("./radio/script/lang.php");
require ("./radio/script/config.php");
require ("./radio/script/players.php");
if ($streamstatus == "1") {
// On-line
    echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">Εβδομαδιαίο Πρόγραμμα Ραδιοφωνικού Σταθμού</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['now_playing'] . ': </b>' . $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' . $phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>Έχετε Skype;<br />Μιλήστε ζωντανά με τον παραγωγό και κάντε φωνητικές αφιερώσεις κάνοντας click στο παρακάτω εικονίδιο!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

';
  }

Thank you very very much.
Title: Re: I need some help with a custom block
Post by: Blue on July 21, 2011, 11:55:57 AM
It works on mine :(

Those are notice errors. No big deal but I understand that you want them removed. I added a code to remove notice errors like the ones you are having and it works fine in my test forum.  Are you sure the errors are from this block?

Let's try this, then... Last hope:
Code: [Select]
<?php

//Remove Notice Errors
error_reporting(0); 

//HTML Block Code
echo '
<script type="text/javascript">
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,sc rollbars=No,resizable=No,status=No,width=700,heigh t=500,left=150,top=150,");
}
//-->
</script>

<div style="text-align: center;">
<a href="javascript:void(0);" onclick="javascript:Start ("http://mydomain.com/chat/flashchat.php");">FlashChat</a>
</div>'
;

//Second Code
require ("./radio/script/lang.php");
require (
"./radio/script/config.php");
require (
"./radio/script/players.php");
if (isset(
$streamstatus)) {
// On-line
    
echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">?ßd?µad?a?? ?????aµµa ?ad??f?????? Sta?µ??</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['now_playing'] . ': </b>' $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>??ete Skype;<br />????ste ???ta?? µe t?? pa?a???? ?a? ???te f???t???? af?e??se?? ?????ta? click st? pa?a??t? e?????d??!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

'
;
  }


?>
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 21, 2011, 12:03:00 PM
Please take a look on my previous post where the codes are completed.
Are not the same on your code.
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 21, 2011, 07:36:57 PM
Blue are you there ?
Title: Re: I need some help with a custom block
Post by: Blue on July 21, 2011, 08:16:35 PM
Code: [Select]
<?php
//Remove Notice Errors
error_reporting(0);

echo 
'
<script type="text/javascript">
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,sc rollbars=No,resizable=No,status=No,width=700,heigh t=500,left=150,top=150,");
}
//-->
</script>

<div style="text-align: center;">
<b><a href="javascript:void(0);" onclick="javascript:Start ("http://www.vinilio.com/chat/flashchat.php");">S??des? St? Chat</a></b>
</div>

<hr />
<center><iframe frameborder="0" height="100" width="160" src="http://www.vinilio.com/chat/info_embedded.php" style="width: 140; margin: 0; padding: 0; border: 0;" scrolling="auto" border="0" allowtransparency="true"></iframe></center>'
;

require (
"./radio/script/lang.php");
require (
"./radio/script/config.php");
require (
"./radio/script/players.php");
if (
$streamstatus == "1") {
// On-line
    
echo '<table width="100%"><center><a href="http://www.vinilio.com/index.php?page=schedule">?ßd?µad?a?? ?????aµµa ?ad??f?????? Sta?µ??</a></center><hr /><tr><a id="onlineRadioLink" href="http://radiotuna.com/OnlineRadioPlayer/Create/singleStationPlayer">shoutcast flash player</a><script type="text/javascript" src="http://radiotuna.com/OnlineRadioPlayer/EmbedRadio?playerParams=%7b%22styleSelection0%22%3a0%2c%22styleSelection1%22%3a0%2c%22styleSelection2%22%3a0%2c%22textColor%22%3a16777215%2c%22backgroundColor%22%3a8821027%2c%22buttonColor%22%3a11531148%2c%22glowColor%22%3a11531148%2c%22playerSize%22%3a200%2c%22userGuid%22%3a%22090496ca-e2e8-4274-a4d1-38fefd2226a4%22%2c%22streamId%22%3a81655%2c%22playerTitleText%22%3a%22Vinilio%2520Team%2520Radio%2520Player%22%2c%22playerType%22%3a%22singleStation%22%7d&width=167&height=180"></script><br /></td></tr></table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['now_playing'] . ': </b>' $song[0] . '</td>
</tr>
</table>
<hr />
<table width="100%">
<tr>
<td><b>' 
$phrase['paragogos'] . ':</b></td>
<td><iframe frameborder="0" height="35" width="85" src="http://www.vinilio.com/radio/producer_name.php" style="width: 80; margin: 0; padding: 0; border: 0;" scrolling="no" border="0" allowtransparency="true"></iframe>
</td>
</tr>
</table>
<hr />
<table width="100%">
<center>??ete Skype;<br />????ste ???ta?? µe t?? pa?a???? ?a? ???te f???t???? af?e??se?? ?????ta? click st? pa?a??t? e?????d??!</center>
<tr>
<td>
<center><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:Vinilio.com?call"><img src="http://mystatus.skype.com/smallclassic/Vinilio%2Ecom" style="border: none;" width="114" height="20" alt="My status" /></a></center>
</td>
</tr>
</table>

'
;
  }
 
?>
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 21, 2011, 09:47:40 PM
I am still getting title and href errors :(


EDIT: Also the popup javascript link is not working...
Title: Re: I need some help with a custom block
Post by: Blue on July 21, 2011, 11:52:03 PM
I haven't changed the code. I just added

Code: [Select]
//Remove Notice Errors
error_reporting(0);

Probably the errors you are getting aren't from this block since with the code above it hides all errors from it.
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 21, 2011, 11:57:48 PM
If the errors are not coming from this block, can you tell me how can i find for sure from what block they are ?

Also can you tell me what to do to make the javascript popup link work ?

Thank you and sorry for all the trouble...
Title: Re: I need some help with a custom block
Post by: Chen Zhen on July 22, 2011, 07:38:26 AM

For the chat link/popup, get rid of the first javascript function and change the first html link to this:
Code: [Select]
<a href="javascript:void(0);" onclick="javascript:window.open(\''.'http://mydomain.com/chat/flashchat.php\',\'FlashChat\',\'width=700,height=500,resizable=1\');");">FlashChat</a>
You could also get rid of the href and put the void(0) right in the onclick but the above should work as it is.

As for your radio, one would need the php files to test and get it working.
I did not look into it perhaps blue will resolve your issue for that.

psst..center tags are deprecated... use style attributes for the tag in use.
Title: Re: I need some help with a custom block
Post by: Blue on July 22, 2011, 10:04:14 AM
If the errors are not coming from this block, can you tell me how can i find for sure from what block they are ?

The best way is to disable all blocks and start enabling them one by one until you find the one that's causing the errors.
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 23, 2011, 04:13:38 AM

For the chat link/popup, get rid of the first javascript function and change the first html link to this:
Code: [Select]
<a href="javascript:void(0);" onclick="javascript:window.open(\''.'http://mydomain.com/chat/flashchat.php\',\'FlashChat\',\'width=700,height=500,resizable=1\');");">FlashChat</a>
You could also get rid of the href and put the void(0) right in the onclick but the above should work as it is.

Thank you very very much for that. Is working :)



The best way is to disable all blocks and start enabling them one by one until you find the one that's causing the errors.

OK. I will try to find what block causing the errors and i will report back here.

Thank you for everything Blue :)
Title: Re: I need some help with a custom block
Post by: Yngwiedis on July 23, 2011, 05:25:15 AM
OK...

I put that:

Code: [Select]
//Remove Notice Errors
error_reporting(0);

in some of my custom blocks and i dont get any errors now.

Is a "dirty" solution but i cant do anything else.

Thank you very very much Blue and Underdog  :D


EDIT: Pfff... I am still getting errors about title and href.
This is getting frustrated...

I think i will leave it as it is. I cant find from what block this errors coming.
SimplePortal 2.3.8 © 2008-2024, SimplePortal