TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 01:06:10 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 120
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 97
  • Total: 97

Extended block access

Started by npereira, March 21, 2007, 06:43:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

npereira

ok...Ã,  thanks

That's what I'm trying to figure out at this time, how to work the snippet codes inside a phpbox and I keep getting this error:

Parse error: syntax error, unexpected '<' in /public_html/Sources/Load.php(1749) : eval()'d code(35) : eval()'d code on line 1

npereira

This is a code I was just testing, and getting the above error:

<?php

ssi_boardNews($board = 6.0, $limit = 5, $start = null, $length = 250, $output_method = 'echo');

?>

IchBin

You do not need the <?php and ?> in your code, as TP already set them. I'm almost there with my code, I just can't figure out how to make it "not" display on the frontpage.

npereira

HAAA !    BINGO !  Thanks dude !

IchBin


global $context;
if($context['current_action'] == '')
$current_action = 'home';
//$current_action = 'forum';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = 'forum';
if($current_action == 'forum')
{
echo 'all your HTML goes here or PHP';
}
else
{
return;
}


Let me know if you need help putting your code in this.
This should show EVERYWHERE except on the frontpage.
* IchBinâ„¢ crosses his fingers.

npereira

Ya well, something is wrong because here is how I setup the above code as far as Custom Action:

Show for this action (custom action name): Forum , forum
Show when inside this board : TESTIN Forum
Show inside this TP section : none
Show when viewing this article : none
Show when viewing this category listing : none
Show for this language : none

The block still shows in the main forum "index.php?action=forum"

npereira

hmmm... ok ... can you explain the code and what it does?

IchBin

The code I posted checks to see where you are in the forum. If the action is equal to all the stuff in the array then $current_action is equal to forum. It also check to see if your url has "board" or "topic" in it.. if so, it sets $current_action is equal to forum again. If the there is no "current_action" it will only "return;", which is nothing.

Hence the if statement which says, if $current_action is equal to forum "echo all your stuff to the block", else echo nothing.

IchBin

So to use your code in my code it would look like this.
global $context;
if($context['current_action'] == '')
$current_action = 'home';
//$current_action = 'forum';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = 'forum';
if($current_action == 'forum')
{
ssi_boardNews($board = 6.0, $limit = 5, $start = null, $length = 250, $output_method = 'echo');
}
else
{
return;
}

npereira

#19
Holy crap !Ã,  I gain about 1 month of knowledge in PHP in 1 post !Ã,   Dude you ROCK !

Next question, LOL

If I want to set it to specific boards? lets say board=5.0 and board=6.0Ã,   ...?

Also, do I have to do anything in the custom action section?