We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Upcoming Events Displayed in a Portal Section
Topic Started: Aug 31 2017, 07:13 AM (305 Views)
Fireball Stars
Member
[ * ]
Hello, I've been dealing with this problem for years now and was very happy to find out that there's a support forum like where I can request a script from some really helpful and talented people, and also find many other scripts that can be really useful to my community.

So, my forums are the home of the brazillian competitive smash community and we've been using a very innefficient system to display the next tournaments coming soon as well as the latest results, in two portal sections on the right of the page, the problem is that we have to update both manually fairly frequently as the number of events increase all over the country. That workload alone has prevented me from working on the forums a lot just because I know I'll have to put a lot of stuff on those sections.

You can see it here: http://1upsmash.com/site/

We do have the default zetaboards calendar however, which would very useful, if there was a way to quickly have access to the links of those threads. My request then is to have the upcoming events sections to autoupdate based on the events that get listed on the calendar by the members in a manner similar to how it is listed right now. If not the calendar, the threads in the event announcement sub-forum.

Quote:
 
[CURRENT MONTH]:

[EVENT'S NAME] - [LOCATION]
(DATE OF THE EVENT)
TOURNAMENTS
[LINK TO THREAD]

[OTHER EVENTS]




[NEXT MONTH]
[...]


Perhaps taking the info from the event's description in the calendar. Would be super helpful too if it showed every event already scheduled in the future. To maybe not make things harder, have repeated events (like weeklies) always displayed on a separate section, with a way to see when it does repeat. If there's control over where each section is located in the portal it would be even more convenient as well as if the events automatically no longer appear if their event date has passed.

Probably the same can't be done for the results section, as it could require the contents of threads to show the top 3 competitors, but a section just displaying the last topics from 6 months ago in a specific sub-forum below the other two sections would be absolutely awesome (as we have a sub-forum just for those topics). This system would heavily streamline the process and make it easier for every tournament organizer in the country to get their events publicized

Thanks in advance to whoever tackles this, you already have my gratitude.

Also, we have a national discord server, is there a way to integrate the discord widget into the portal? If you guys could point me to where I can get that info I'd very grateful!
Edited by Fireball Stars, Aug 31 2017, 07:23 AM.
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
I made the code for you --> http://support.zathyus.com/topic/7011844/1/

As for the past competitions. It is possible to do but it would be another request on the server every time the portal page is loaded and I don't think we're allowed too many of those running simultaneously. But if you someone from the support staff sees this or you can contact them and ask I think it could be done. It would require topics in that subforum to be something like "Competition Title" as the topic title, and "Top Competitors" as the description. And... it would only show as many topics as you have set to be shown per page. Meaning it wouldn't show them for the last six months but rather if you had 20 competitions in one month it would only show those 20 and no more.

---

As for the Discord Widget... I don't use Discord Myself but I found a blog post on google https://blog.discordapp.com/add-the-discord-widget-to-your-site-d45ffcd718c6
Try finding the Widget and copying the code they give you, then go to your Admin CP -> Board Settings -> Portal Manager and Add New Portal Content Block. You can choose where you want it to display. Simply post the Widget code into the box and done.
Edited by l1r72, Sep 1 2017, 12:26 AM.
Offline Profile Goto Top
 
Fireball Stars
Member
[ * ]
l1r72
Aug 31 2017, 08:53 PM
I made the code for you --> http://support.zathyus.com/topic/7011844/1/

As for the past competitions. It is possible to do but it would be another request on the server every time the portal page is loaded and I don't think we're allowed too many of those running simultaneously. But if you someone from the support staff sees this or you can contact them and ask I think it could be done. It would require topics in that subforum to be something like "Competition Title" as the topic title, and "Top Competitors" as the description. And... it would only show as many topics as you have set to be shown per page. Meaning it wouldn't show them for the last six months but rather if you had 20 competitions in one month it would only show those 20 and no more.

---

As for the Discord Widget... I don't use Discord Myself but I found a blog post on google https://blog.discordapp.com/add-the-discord-widget-to-your-site-d45ffcd718c6
Try finding the Widget and copying the code they give you, then go to your Admin CP -> Board Settings -> Portal Manager and Add New Portal Content Block. You can choose where you want it to display. Simply post the Widget code into the box and done.
It works perfectly! Thanks a lot l1r72, I've added the discord widget to the portal as well, although it it's a little squished for now. There's only the problem that the css doesn't work with ids that have accents on them, such as "ó", it worked perfectly on my test boards though so I imagine it has something to do with my boards being older.

The only other improvements I can think of is being able to make it go back to normal if you click the title, currently, once the contents are visible, it stays like that until you refresh the page or go elsewhere. Would that be possible? Also Have the events more clearly separated when not expanded, currently they stay very close together and it makes reading them slightly harder than it should, something as single and having a horizontal line dividing the events should work.

It's already a huge reduction on the workload so I should be satisfied, I can certainly live with this, but if someone could do the script for the tournament results it would be definitely the best scenario to get time to work more on other parts of the forums. I imagined it would be done in the way you said, it would be already more than enough for me, if the extra request on the server is ok.

One last question is it possible to make the event topics to be able to display emotes? Is a script necessary for that or is there some setting in the Admin CP that I'm not seeing?
Edited by Fireball Stars, Sep 1 2017, 10:09 PM.
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
Code:
 
<script type="text/javascript">
/*

Code: Show Upcoming Events on the Portal Page
For More Visit: http://s15.zetaboards.com/zetapro/index/

*/

var box_name = 'Upcoming Events';
var remove_content = false;

if (location.href.indexOf('/site') !== -1) {

$.get(main_url + 'index/?force_ads', function(data) {
var links = $(data).find('#stats_events').children('a');
var portal_box_exists = $('.portal_box h2:contains(' + box_name + ')').length;
if(portal_box_exists) {
$('.portal_box h2:contains(' + box_name + ')').next('.portal_content').attr('id','upcomingevents');
if(remove_content == true) {
$('#upcomingevents').html('');
} else {
$('#upcomingevents').wrapInner('<div class="previous_content"></div>');
}
$('#upcomingevents').append('<ul></ul>');
$.each(links, function() {
var date = $(this).attr('title');
var link = $(this).attr('href');
var text = $(this).text();
$('#upcomingevents ul').append('<li><date>' + date + '</date><span class="upcomingevents" title="' + link + '">' + text + '</span></li>');
});
}
$('span.upcomingevents').click(function () {
if($(this).hasClass('clicked')) {
$(this).next('.event_content').hide();
} else {
if($(this).next('.event_content').length) {
$(this).next('.event_content').show();
} else {
var clicked = this;
$(this).addClass('clicked');
var url = $(this).attr('title');
$.get(url + '?force_ads', function(data) {
var content = $(data).find('.c_post').html().trim();
$(clicked).after('<div class="event_content">' + content + '</div>');
});
}
}
});
});

}
</script>


Use this code instead. And the CSS will now simply be exactly the one I have as an example you. It removes all the hassle. It should also remove hide and show when you click the title.

---

For the tournament results you would have an archive forum where you move all the thread after the tournament is over. You would need to have the title of the topic as whatever you need, but after the end of the tournament you will need to edit the description. The downside is that the description can only be 125 characters long. The way you show the results seems to be enough, 1º - TSL|Maroli / 2º SmashRS|Lukitu / 3º Lukingordex is only 52 characters long. I have spoken to the support staff and I think it should be okay to do it.

As for emotes on event topics, you will have to make a post in the ZetaBoards support place. I really don't know about that.
Offline Profile Goto Top
 
Fireball Stars
Member
[ * ]
Oh, I meant being able to hide the contents again by clicking the title after it has been revealed, not removing the feature. It was a really great idea to avoid clutter in the portal, being able to hide it again is just to add to the user experience due to it being intuitive if the user wants to hide the contents again in the case they are searching for something or checking the events. It would be particularly useful when the OP doesn't use the feature properly and it breaks the formatting of the page or makes it just look ugly, works as a fix until a moderator adjusts the event's post to the rules without having to refresh the page.

The current css works well despite the lack of a clear separation of a line (I did make some adjustments from your example css, but it seems like it doesn't have the line because of interations of the generall css of the theme), maybe going with an alternative that doesn't use css wouldn't be good in the long because I know enough about css to edit it if necessary, in the case the theme is changed in some way in the future.

Using the script without css included would preserve the way it looks right now? Like font color, weight, background color and cursor types on hover? As those where the things I had to alter previously.

About the tournament results block, thanks for reaching out to the support staff for me! We do have a separate sub-forum where people post topics especifically for results, would that work as an alternative to an archive forum? As long as the OPs update their topic descriptions with the results that is.

And thanks again for using your time to help me out, the community is already loving the new feature with the calendar.
Edited by Fireball Stars, Sep 2 2017, 08:12 AM.
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
I shall test my code and try to fix it and also make the second code for you as well. The way you have it set up shall work with a few minor changes you will have to make in the Admin CP.
Offline Profile Goto Top
 
Fireball Stars
Member
[ * ]
All right, thanks again!
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
Updated the Old Code ---> http://support.zathyus.com/topic/7011844/1/

New Code for you for the Topics ---> http://support.zathyus.com/topic/7011903/1/
The new code will have to be changed a bit to display the winners on a new line instead of one after the other. Here's what you should use instead:
Code:
 
<script type="text/javascript">
/*

Code: Show Topics on the Portal Page
For More Visit: http://s15.zetaboards.com/zetapro/index/

*/

var topics_box_name = 'Previous Events';
var topics_forum_id = '1234567';
var topics_remove_content = false;
var topics_including_pinned = true;
var tppics_results_separator = '|';

if (location.href.indexOf('/site') !== -1) {

$.get(main_url + 'forum/' + topics_forum_id + '/?force_ads', function(data) {
if(topics_including_pinned == true) {
var posts = $(data).find('.posts tbody').children('tr.row1, tr.row2');
} else {
var posts = $(data).find('.posts tbody').children('tr.row1, tr.row2').not('.pin');
}
var portal_box_exists = $('.portal_box h2:contains(' + topics_box_name + ')').length;
if(portal_box_exists) {
$('.portal_box h2:contains(' + topics_box_name + ')').next('.portal_content').attr('id','showtopics');
if(topics_remove_content == true) {
$('#showtopics').html('');
} else {
$('#showtopics').wrapInner('<div class="previous_content"></div>');
}
$('#showtopics').append('<ul></ul>');
$.each(posts, function() {
var topic = $(this).children('.c_cat-title');
var title = topic.children('a').text();
var link = topic.children('a').attr('href');
var get_date = topic.children('a').attr('title');
var date_0 = get_date.replace('Start Date ','');
var date_1 = date_0.split(',');
var date = date_1[0];
var description = topic.children('.description').text();
if(!description) {
var desc = '';
} else {
var desc = '';
var results_array = description.split(topics_results_separator);
$.each(results_array, function(key,value) {
desc += '<span class="result">' + value +'</span>';
});
}
$('#showtopics ul').append('<li><date>' + date + '</date><a class="showtopics" title="' + link + '">' + title + '</a>' + desc + '</li>');
});
}
});

}
</script>


Change the line that says 'topics_results_separator' to whatever you want to separate the winners by.
Edited by l1r72, Sep 3 2017, 06:29 PM.
Offline Profile Goto Top
 
Fireball Stars
Member
[ * ]
Yo, I just tested both codes. The first code is working perfectly and the only problem in function right now is with the results topic code, when hovering the topic titles it shows as a link but it does not allow me to click on them. You can see it on http://www.1upsmash.com if necessary.

My last suggestions have to do with the aesthetics. As you can see below, on the results section (the lower one), the date and topic title are perfectly set up, but the description is on the same line as the topic title which causes weird line breaks right now. The second is to be able to have the same sort of separation between events on the upcoming events box (the one above) as there is currently between the results topics.
Spoiler: click to toggle


With those three things fixed it will be 10/10.
Offline Profile Goto Top
 
l1r72
Member Avatar
Member
[ *  *  * ]
Use the CSS I that's given for both codes. It makes them look much nicer. As for the results on their own line...

#showtopics .result { display: block; }

Now each result shows on its own line.

For the link click.

Change this:

Code:
 
<a class="showtopics" title="' + link + '">


to this:

Code:
 
<a class="showtopics" href="' + link + '" title="' + link + '">
Offline Profile Goto Top
 
Fireball Stars
Member
[ * ]
Both codes seem to be working 100% as we needed now! Thank you so much, now tournament divulging through the forums is many times more efficient for the community.

I was using your example CSS for the first with just some adjustments to make it fit the theme's aesthetic, like color and making sure the right cursor type is displayed over the event names. But just now I noticed that there was a typo from when I was changing the ids, right now it's displayed as intended, just now I see that I was requesting something you already provided haha.

I believe that then the request is closed.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Fully Featured & Customizable Free Forums
Learn More · Register for Free
« Previous Topic · Closed Requests · Next Topic »
Locked Topic