collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 502
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Jumpto in portal block  (Read 12722 times)

0 Members and 1 Guest are viewing this topic.

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Jumpto in portal block
« on: October 04, 2012, 03:55:32 PM »
Can anyone make this bit of code jump to selection with out having to use the go button? I asked the question where the individual made that piece of code but he just gave me a link to search for the answer and I haven't found anything that worked and I don't have a clue what I am doing with anything I find.

Here is the code:
Code: [Select]
global $context, $sourcedir, $modSettings, $txt;

if (empty($context['categories']))
{
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
}

if (empty($context['categories'])) return;

echo '
<div class="windowbg" style="margin-top: 10px;">
<span class="topslice"><span></span></span>
<div class="content">
<form action="">
<label for="jump_below">', $txt['jump_to'], ':</label>
<select name="board" id="jump_below">';

foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';

foreach ($category['boards'] as $id_board => $board)
echo '
<option value="', $id_board, '">', $board['name'], '</option>';

echo '
</optgroup>';
}

echo '
</select>
<input type="submit" class="button_submit" value="', $txt['go'], '" style="text-transform: capitalize;" />
</form>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';
 

The original discussion was here:
http://www.simplemachines.org/community/index.php?topic=465107.new;topicseen#new

Hope I put this in the right place to get the answer. I'm not sure where I am supposed to put what..  :O
Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #1 on: October 04, 2012, 04:07:30 PM »
Some parts stolen from Quick PM block (by Dr. Deejay) >:-D

Code: [Select]
global $context, $sourcedir, $modSettings, $txt, $scripturl;

if (empty($context['categories']))
{
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
}

if (empty($context['categories'])) return;

echo '
<div class="windowbg" style="margin-top: 10px;">
<span class="topslice"><span></span></span>
<div class="content">
<form action="#" method="post">
<label for="jump_below">', $txt['jump_to'], ':</label>
<select name="board" onchange="if (this.value) window.location.href=this.value">';

foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';

foreach ($category['boards'] as $id_board => $board)
echo '
<option value="', $scripturl, '?board=', $id_board, '">', $board['name'], '</option>';

echo '
</optgroup>';
}

echo '
</select>
<input type="submit" class="button_submit" value="', $txt['go'], '" style="text-transform: capitalize;" />
</form>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #2 on: October 04, 2012, 04:29:52 PM »
You would not believe the things I tried the last couple of hours to get that thing to do that. Ugh Thank you so much.

Originally I set off to find a jump to box that would not just take a person to a particular board but would open a NEW TOPIC for that board. I got this for finding something that brought me to the selected board but not one that would take me to Open a new topic in it.

Is that easy to do? Or is that more complicated?

I have adk topic button which starts a new topic in the board shown in the category view, but I'd love a jump box where the member can chose the board they want to post a new topic in and it jumps to the new topic for that board.

My members and often I myself I don't have a lot of time to post so it would be most useful to get new topics posted quickly.

I did ask this question in the original topic too but got just a link to search, and my searches came up empty or just not related, and then I end up putting in bits of code that either throw an error at me or just don't work.

Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #3 on: October 04, 2012, 04:38:18 PM »
I'm not sure.. you want something like this:
Code: [Select]
global $context, $sourcedir, $modSettings, $txt, $scripturl;

if (empty($context['categories']))
{
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
}

if (empty($context['categories'])) return;

echo '
<div class="windowbg" style="margin-top: 10px;">
<span class="topslice"><span></span></span>
<div class="content">
<form action="#" method="post">
<label for="jump_below">', $txt['jump_to'], ':</label>
<select name="board" onchange="if (this.value) window.location.href=this.value">';

foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';

foreach ($category['boards'] as $id_board => $board)
echo '
<option value="', $scripturl, '?action=post;board=', $id_board, '">', $board['name'], '</option>';

echo '
</optgroup>';
}

echo '
</select>
<input type="submit" class="button_submit" value="', $txt['go'], '" style="text-transform: capitalize;" />
</form>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';
?

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #4 on: October 04, 2012, 05:17:00 PM »
Yes yes yes yes yes. That puts it all together into exactly what I started out looking for. Big hug, Thank you thank you thank you.

Now just one last question, would this work no matter where I put it or is it just designed to work in a block? Not sure I need it elsewhere at the moment but just curious.
Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #5 on: October 04, 2012, 05:19:25 PM »
I think that it should work outside block, but I would have to check it out later.

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #6 on: October 04, 2012, 05:24:37 PM »
I think that it should work outside block, but I would have to check it out later.

Ok because I followed Bugo's instructions on this page, http://www.simplemachines.org/community/index.php?topic=465107.new;topicseen#new

And up loaded the three files and ran hooks.php sucsessfully, but
there was no instruction how to make all that show on the forum. And I don't know if his block code for jumpto that I posted here was related to those instructions.

Thank you Phantomm for all your help. You made my day.
Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #7 on: October 05, 2012, 07:40:44 AM »
You know, that this code from Bugo is exactly the same as this from Mod Site? Only difference is that Bugo's version doesn't edit any files, cause instead it's using hooks .

At least that's how I see it.

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #8 on: October 05, 2012, 12:03:52 PM »
Well I don't really understand about the hooks thing but always like it when mod doesn't change files. But I still don't know what his code does exactly, since it doesn't modify any files, how do you get it to show up? And where? You must have to put a piece of code somewhere to make it show up right?
Using SMF 2.0.2 and Simple portal 2.3.5

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #9 on: October 06, 2012, 09:41:36 AM »
Now this is starting to be offtopic :P

Hooks install file is adding proper entries in SMF database, and this tells SMF what code should be loaded in selected places from PHP files.
I guess that better place to ask questions about hooks is simplemachines.org :)

Offline boo2

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #10 on: October 06, 2012, 01:03:07 PM »
Now this is starting to be offtopic :P

Hooks install file is adding proper entries in SMF database, and this tells SMF what code should be loaded in selected places from PHP files.
I guess that better place to ask questions about hooks is simplemachines.org :)

No problem, Phantom, wasn't really asking about hooks, I wanted to know what makes his code actually show up somewhere in the forum. I followed all the instructions, but the one instruction to make it show up was not there. So the hooks being run and the files being placed where they should be, is pretty much useless if I don't know what makes it show up on the page.

It's just like this thread here, with out the piece that you supplied I could not have made the block thing work for me.

I don't know if his code even has anything to do with the block part, or it puts the jump somewhere else, but with out the piece that makes it go somewhere else, I don't know if anything I did in his instructions are even related other than it being jump related.
Using SMF 2.0.2 and Simple portal 2.3.5

Offline fapencio

  • Jr. Member
  • **
  • Posts: 61
  • Gender: Male
    • medilibros
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #11 on: May 07, 2014, 09:22:56 PM »
Some parts stolen from Quick PM block (by Dr. Deejay) >:-D

Code: [Select]
global $context, $sourcedir, $modSettings, $txt, $scripturl;

if (empty($context['categories']))
{
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
}

if (empty($context['categories'])) return;

echo '
<div class="windowbg" style="margin-top: 10px;">
<span class="topslice"><span></span></span>
<div class="content">
<form action="#" method="post">
<label for="jump_below">', $txt['jump_to'], ':</label>
<select name="board" onchange="if (this.value) window.location.href=this.value">';

foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';

foreach ($category['boards'] as $id_board => $board)
echo '
<option value="', $scripturl, '?board=', $id_board, '">', $board['name'], '</option>';

echo '
</optgroup>';
}

echo '
</select>
<input type="submit" class="button_submit" value="', $txt['go'], '" style="text-transform: capitalize;" />
</form>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';

phantomm your block is nice, I implemented this block in my forum, that was how it was:



works on all subforums, but does not work in the first subforum precisely where it appears in the picture, it is the only subforum I need to click the button "Go" , when I click the button "Go"  nothing happens , I would like to help me correct that "bug", and please make the block is as it is on this site: medicomoderno.org



ie, instead of display the first sub-forum, show the title "choose category" and remove the "Go" button please

Theme: Default

Offline fapencio

  • Jr. Member
  • **
  • Posts: 61
  • Gender: Male
    • medilibros
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #12 on: May 08, 2014, 09:58:05 PM »
help please
Theme: Default

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #13 on: May 10, 2014, 01:30:59 PM »
Something like this?
Code: [Select]
global $context, $sourcedir, $modSettings, $txt, $scripturl;

if (empty($context['categories']))
{
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
}

if (empty($context['categories'])) return;

echo '
<div class="windowbg" style="margin-top: 10px;">
<span class="topslice"><span></span></span>
<div class="content">
<form action="#" method="post">
<select name="board" onchange="if (this.value) window.location.href=this.value">
<option value="0" selected="selected" disabled="disabled">Select board</option>';

foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';

foreach ($category['boards'] as $id_board => $board)
echo '
<option value="', $scripturl, '?board=', $id_board, '">', $board['name'], '</option>';

echo '
</optgroup>';
}

echo '
</select>
</form>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';

Offline fapencio

  • Jr. Member
  • **
  • Posts: 61
  • Gender: Male
    • medilibros
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Jumpto in portal block
« Reply #14 on: May 10, 2014, 01:51:15 PM »
Something like this?

exactly, now work perfect,  :thumbsup:

the help you provide is invaluable, without you we do not know of code would know what not to do

thanks a lot phantomm  :thumbsup: :applause:
Theme: Default

Offline phantomm

  • Translator
  • *
  • Posts: 406
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • Elkarte Version: 1.0.5
Re: Jumpto in portal block
« Reply #15 on: May 10, 2014, 04:39:53 PM »
You're Welcome :)