форум vBSupport.ru > vBulletin > vBulletin 3.8.x > Вопросы по vBulletin 3.8
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
Unhappy product I'm developing
0

I am trying to show external link clicks next to links in post, like how twitter forums do:
Click image for larger version

Name:	2016-03-25_11-54-41.png
Views:	51
Size:	255.0 KB
ID:	28713

I have everything ready, I just need help getting the count to show next to links in post through plugins.
Click image for larger version

Name:	2016-03-25_11-56-53.png
Views:	65
Size:	191.6 KB
ID:	28714


plugin:
postbit_display_complete
Code:
$this->post['message'] = str_replace('href="', 'href="./out.php?link=', $this->post['message']);
$this->post['signature'] = str_replace('href="', 'href="./out.php?link=', $this->post['signature']);
this captures any link posted and sends it through out.php

out.php which captures the link to the database:
PHP Code:
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''drc-lf');
require_once(
'./global.php');

if (isset(
$_GET['link'])) {
    
// format passed url
    
$drc_url $_GET['link'];
    unset(
$_GET['link']);
    if(
count($_GET))
        
$drc_url $drc_url '&' http_build_query($_GET);

    
// deals w/ the display if $drc_url is a valid URL
    
if (filter_var($drc_urlFILTER_VALIDATE_URL)) {
        
$site parse_url($_SERVER['HTTP_HOST']);
        
$site $site['path'];
        
$url parse_url($drc_url);
        
        
// the passed url is not an external link
        
if ($site == $url['host']) {
            
Header"Location: "$drc_url);
        }
        
// the passed url is an external link
        
else {
          
$query $db->query_first("SELECT * FROM "TABLE_PREFIX ."redirect WHERE url = '" $drc_url "'"); 
          if (!
$query){ 
              
$db->query_write("INSERT INTO "TABLE_PREFIX ."redirect (url, hits) VALUES ('" $drc_url "', 1)");
          } else { 
              
$db->query_write("UPDATE "TABLE_PREFIX ."redirect SET hits = hits + 1 WHERE url = '" $drc_url "'"); 
          }  
           
            eval(
'print_output("' fetch_template('drc_lf') . '");');
        }
    
// open invalid link
    
} else {
        
Header"Location: "$drc_url);
    }

So I have the data I need, I just don't know where to go from here.
Something like this should return the results:
Code:
$vbulletin->db->query_first("
  SELECT SUM(hits) AS hits
  FROM " . TABLE_PREFIX . "redirect
  WHERE url = '$drc_url'
");
I just don't know what to do with it, what plugin to create it in, or maybe even a cron task. I just need some help getting the final result like the first IMG
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
kerk
k0t
 
kerk's Avatar
Default
0

PHP Code:
filter_var($drc_urlFILTER_VALIDATE_URL
this function (filter_var) won't work with national domains like россия.рф
PHP does not support yet http://php.net/manual/ru/function.filter-var.php#111828
debug:
PHP Code:
$url1 'http://россия.рф/';
$url2 'http://russia.ru/';
print 
'<pre>';
var_dump(filter_var($url1FILTER_VALIDATE_URL));
print 
'<br />';
var_dump(filter_var($url2FILTER_VALIDATE_URL));
print 
'</pre>'
result


more reasons do not use this function in your projects
http://php.net/manual/ru/function.filter-var.php#118257
http://php.net/manual/ru/function.filter-var.php#108769
http://php.net/manual/ru/function.filter-var.php#118676
 


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 01:50 PM.


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