форум vBSupport.ru > vBulletin > Вопрос — Ответ
Register Меню vBsupport Изображения Files Manager О рекламе Today's Posts Search
  • Родная гавань
  • Блок РКН снят
  • Premoderation
  • For English speaking users
  • Каталог Фрилансеров
  • If you want to buy some product or script
  • Администраторам
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей

Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
for English speaking users:
You may be surprised with restriction of access to the attachments of the forum. The reason is the recent change in vbsupport.org strategy:

- users with reputation < 10 belong to "simple_users" users' group
- if your reputation > 10 then administrator (kerk, Luvilla) can decide to move you into an "improved" group, but only manually

Main idea is to increase motivation of community members to share their ideas and willingness to support to each other. You may write an article for the subject where you are good enough, you may answer questions, you may share vbulletin.com/org content with vbsupport.org users, receiving "thanks" equal your reputation points. We should not only consume, we should produce something.

- you may:
* increase your reputation (doing something useful for another members of community) and being improved
* purchase temporary access to the improved category:
10 $ for 3 months. - this group can download attachments, reputation/posts do not matter.
20 $ for 3 months. - this group can download attachments, reputation/posts do not matter + adds eliminated + Inbox capacity increased + files manager increased permissions.

Please contact kerk or Luvilla regarding payments.

Important!:
- if your reputation will become less then 0, you will be moved into "simple_users" users' group automatically.*
*for temporary groups (pre-paid for 3 months) reputation/posts do not matter.
Уважаемые пользователи!

На форуме открыт новый раздел "Каталог фрилансеров"

и отдельный раздел для платных заказов "Куплю/Закажу"

Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже:
Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
 
 
 
 
DrCustUmz
Знаток
 
DrCustUmz's Avatar
Exclamation Creating a Load More button, Need Some Assistance
0

So this is petty standard feature of most sites today, load more by pressing a button. So what Im trying to do is make an ajax request to a duplicated modified forumdisplay.php to load the next page of threads automatically.

Heres the procedure.
In my forumdisplay template I have created an ajax script:
Code:
<script>
	$(document).ready(function(){
		$('.load-more').click(function(){
			perpage = $perpage + 10;
			$('.block-threadlist').load('loadmore.php', {
				perPageNew: perpage
			});
		});
	});
  </script>
loadmore.php is essentially a modified duplicate of forumdisplay.php
the notable changes are:
I have included
Code:
$perPageNew = $_POST['perPageNew'];
and I have changed the eval template from FORUMDISPLAY to loadmore

the loadmore template ONLY includes $threadbits

loading loadmore.php in browser, this works exactly how I expect it to, with only showing the threadbits of each thread, un-styled due to not being rendered with the head or any other templates. That's ok though because once they are loaded where they are supposed to be, they should be styled.

The problem comes when I hit my button.
Code:
<button type="button" class="btn btn-primary btn-lg load-more">Load More</button>
Which is placed directly below $threadbits in the forumdisplay template. I am recieving an error.
Quote:
If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.]]>
I have tried striping as much as I could out of the loadmore.php file but I am not getting anywhere with the error.

Can anyone assist me with getting this to function properly?
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
kerk
k0t
 
kerk's Avatar
Default
0

https://vbsupport.ru/forum/showthread.php?t=44794
 
 
DrCustUmz
Знаток
 
DrCustUmz's Avatar
Default
0

@kerk, I saw yours, I'm just trying to create this myself. Too broke to be buying vb3 products lol. As you may have noticed over the years I tend to just play around with code myself and not ever really get my site functional LOL. I have 4 kids and this is just something I do in my down time.

Am I going about it the right way by duplicating the forum display page and using the portion that is for displaying threadbit?

Would you mind sharing your forum display version so I could reverse engineer and see where I'm going wrong? I have a feeling I'm going to need to pass through more information through the ajax call (security token, sort order, page number, and per page for sure)
 
 
kerk
k0t
 
kerk's Avatar
Default
0

@DrCustUmz, I sent you link to download that script via PM
 
 
DrCustUmz
Знаток
 
DrCustUmz's Avatar
Default
0

Thank you kerk, I'm going to play around with this when I get done working tonight

DrCustUmz добавил 03-23-2022 в 01:35 AM
So just got a minute to actually look at it.

When I was making it from scratch my thoughts were if I could just duplicate the forumdisplay portion that calls threadbit I would be good to go. When that failed, I started looking at other products that functioned similarly. All I could find on vb.org was vBSocial infinite for vb4, when I downloaded it I saw they did pretty much exactly what I was doing. Duplicated the forumdisplay file. But they used YUI and I just got stuck trying to make it work with vB3.

Both of our methods (mine and vBsocial) seem like the right approach, but you go about this a totally different way relying almost purely on JS! This is an approach I never would have thought of had I not seen it. Way less code doing it your way too, your awesome kerk!

knowing the method you approached this, I'm going to attempt to ajaxify a few other things ;P

Last edited by DrCustUmz : 03-23-2022 at 05:35 AM. Reason: Добавлено сообщение
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT +4. The time now is 09:08 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.