vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Featured Threads (https://vborg.vbsupport.ru/showthread.php?t=320387)

hazem_aliraqi 01-19-2016 10:22 AM

thank u mark that was awesome installed and 5 stars

Q \ can i get the number (count) of the Featured Threads for each user ?

and add the count to postbit ?

jagtpf 01-19-2016 02:56 PM

Quote:

Originally Posted by jagtpf (Post 2562958)
Line 1394 seems to be pointing at the 'if statement'.

The database in config.php is set to mysql - and everything else, Live and Test are running OK with this setting.


just discovered through diagnostics that vBulletin (admincp) has advised :
class_core.php
Quote:

File does not contain expected contents!

MarkFL 01-19-2016 05:45 PM

Quote:

Originally Posted by jagtpf (Post 2562983)
just discovered through diagnostics that vBulletin (admincp) has advised :
class_core.php

Did you upload a fresh version of that file and now everything works?

MarkFL 01-19-2016 05:47 PM

Quote:

Originally Posted by hazem_aliraqi (Post 2562962)
thank u mark that was awesome installed and 5 stars


Q \ can i get the number (count) of the Featured Threads for each user ?

and add the count to postbit ?

I sort of already have this, if you set "Recognize "Featured Threads" Authors In Postbits/Profiles" to "Yes" in the "Icons" section of the settings. The icon has a tooltip that indicates how many "Featured Threads" the user has authored. :)

ikopylov 01-19-2016 06:34 PM

Hi Mark!
Minor bugs in mod Featured Threads v1.9.7

1
Replase all phrases to {vb:rawphrase vb_standart_phrase}

This is for non English forums

2
Find and replase

<br> ==> <br />
<img src="' . $icon . '">'; ==> <img src="' . $icon . '" alt="" />';
<input bla-bla-bla> ==> <input bla-bla-bla />
<hr></hr> ==> <hr />


3
This is for forums with UTF8:


Code:

$preview = substr($firstpost['pagetext'], 0, $vbulletin->options['threadpreview']);
==>
Code:

$preview = iconv_substr($firstpost['pagetext'], 0, $vbulletin->options['threadpreview'], 'UTF-8');
next

Code:

$forum_trunc = strlen($forum_name) > $forum_length ? substr($forum_name,0,$forum_length) . "...": $forum_name;
==>
Code:

$forum_trunc = strlen($forum_name) > $forum_length ? iconv_substr($forum_name,0,$forum_length, 'UTF-8') . "...": $forum_name;

4
Some forums have a short URL:

Member, Forum, Thread

Code:

return '<a title="' . $title . '" href="member.php?' . $user_name['userid'] . '-' . $user_name['username'] . '" target="_blank">' . $open_tag . $user_name['username'] . $close_tag . '</a>';
==>
Code:

return '<a title="' . $title . '" href="member.php?u=' . $user_name['userid'] . '" target="_blank">' . $open_tag . $user_name['username'] . $close_tag . '</a>';
next

Code:

$thread .= '<a title="' . get_thread_preview($threadinfo['firstpostid']) . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="showthread.php?' . $threadinfo['threadid'] . '-' . str_replace(' ', '-', $threadinfo['title']) . '">' . $threadinfo['title'] . '</a>';
==>
Code:

$thread .= '<a title="' . get_thread_preview($threadinfo['firstpostid']) . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="showthread.php?t=' . $threadinfo['threadid'] . '">' . $threadinfo['title'] . '</a>';
next

Code:

return '<td style="border-right: ' . $vbulletin->options['markfl_ft_border'] . '"><a title="' . $ftitle . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="forumdisplay.php?' . $ftthread['forumid'] . '-' . str_replace(' ', '-', $vbulletin->forumcache[$ftthread['forumid']]['title'])  . '">' . $forum_trunc . '</a></td>';
==>
Code:

return '<td style="border-right: ' . $vbulletin->options['markfl_ft_border'] . '"><a title="' . $ftitle . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="forumdisplay.php?f=' . $thread['forumid'] . '">' . $forum_trunc . '</a></td>';

MarkFL 01-19-2016 07:18 PM

Quote:

Originally Posted by ikopylov (Post 2562993)
Hi Mark!
Minor bugs in mod Featured Threads v1.9.7

1
Replase all phrases to {vb:rawphrase vb_standart_phrase}

This is for non English forums

2
Find and replase

<br> ==> <br />
<img src="' . $icon . '">'; ==> <img src="' . $icon . '" alt="" />';
<input bla-bla-bla> ==> <input bla-bla-bla />
<hr></hr> ==> <hr />


3
This is for forums with UTF8:


Code:

$preview = substr($firstpost['pagetext'], 0, $vbulletin->options['threadpreview']);
==>
Code:

$preview = iconv_substr($firstpost['pagetext'], 0, $vbulletin->options['threadpreview'], 'UTF-8');
next

Code:

$forum_trunc = strlen($forum_name) > $forum_length ? substr($forum_name,0,$forum_length) . "...": $forum_name;
==>
Code:

$forum_trunc = strlen($forum_name) > $forum_length ? iconv_substr($forum_name,0,$forum_length, 'UTF-8') . "...": $forum_name;

4
Some forums have a short URL:

Member, Forum, Thread

Code:

return '<a title="' . $title . '" href="member.php?' . $user_name['userid'] . '-' . $user_name['username'] . '" target="_blank">' . $open_tag . $user_name['username'] . $close_tag . '</a>';
==>
Code:

return '<a title="' . $title . '" href="member.php?u=' . $user_name['userid'] . '" target="_blank">' . $open_tag . $user_name['username'] . $close_tag . '</a>';
next

Code:

$thread .= '<a title="' . get_thread_preview($threadinfo['firstpostid']) . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="showthread.php?' . $threadinfo['threadid'] . '-' . str_replace(' ', '-', $threadinfo['title']) . '">' . $threadinfo['title'] . '</a>';
==>
Code:

$thread .= '<a title="' . get_thread_preview($threadinfo['firstpostid']) . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="showthread.php?t=' . $threadinfo['threadid'] . '">' . $threadinfo['title'] . '</a>';
next

Code:

return '<td style="border-right: ' . $vbulletin->options['markfl_ft_border'] . '"><a title="' . $ftitle . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="forumdisplay.php?' . $ftthread['forumid'] . '-' . str_replace(' ', '-', $vbulletin->forumcache[$ftthread['forumid']]['title'])  . '">' . $forum_trunc . '</a></td>';
==>
Code:

return '<td style="border-right: ' . $vbulletin->options['markfl_ft_border'] . '"><a title="' . $ftitle . '" style="color: ' . $vbulletin->options['markfl_ft_linkcolor'] . '; ' . $vbulletin->options['markfl_ft_linkformat'] .'" href="forumdisplay.php?f=' . $thread['forumid'] . '">' . $forum_trunc . '</a></td>';

1.) Using phrasing (a HUGE task) is on my to-do list. It could be a while before I can get to it.

2.) Those slashes add no functionality to HTML and are not necessary.

3.) I will eventually look into adding UTF-8 encoding functionality. I'm learning as I go.

4.) I tried giving URLs that are the most standard, and play nicely with SEO mods.

ikopylov 01-20-2016 07:18 AM

1.
It is very necessary. Put it at 1st line in you TODO list. )))

2.
If we used the specification DOCTYPE HTML it would be appropriate to use <br>
But in VB we use specification DOCTYPE XHTML in this case it is necessary to use <br />, <hr />, <input />, <img /> and then the code is valid

3.
php substr() function with utf-8 leaves "�" marks at the end before "..."
I showed how to solve this little problem

4.
Maybe you can add settings option SEO link | Standard Link

jagtpf 01-20-2016 08:08 AM

Quote:

Originally Posted by MarkFL (Post 2562990)
Did you upload a fresh version of that file and now everything works?

To be honest, I haven't. Reason being that the Live and Test Forums run perfectly well with the file as it is.
Your Mod seems to be the first instance of something not totally right.

But I'll give it a try and, obviously, let you know.

Many thanks for your kind work and patience on helping.

One food for thought as an enhancement could be options to create more than one variety of nomination? Similar to DBTechs vBnominate...


EDIT : Sorry Mark - have updated the class_core.php file (test forum) - diagnostics clears as OK - but the error continues.

MarkFL 01-20-2016 03:18 PM

Quote:

Originally Posted by jagtpf (Post 2563020)
To be honest, I haven't. Reason being that the Live and Test Forums run perfectly well with the file as it is.
Your Mod seems to be the first instance of something not totally right.

But I'll give it a try and, obviously, let you know.

Many thanks for your kind work and patience on helping.

One food for thought as an enhancement could be options to create more than one variety of nomination? Similar to DBTechs vBnominate...


EDIT : Sorry Mark - have updated the class_core.php file (test forum) - diagnostics clears as OK - but the error continues.

From what I gather from the code you posted, the error has to do with a query...but I don't know which one(s), as there are many queries in this product. What version of vB/PHP/MySQL are you running?

jagtpf 01-20-2016 03:25 PM

Quote:

Originally Posted by MarkFL (Post 2563058)
From what I gather from the code you posted, the error has to do with a query...but I don't know which one(s), as there are many queries in this product. What version of vB/PHP/MySQL are you running?


(Don't forget I'm only running (!) this on my test Forum via xampp; so there might - probably - possibly be fewer/no issues on the Live).

vB 4.2.3 C1

PC - test Forum
Server Type WINNT
Web Server Apache v2.4.17
PHP 5.6.15
MySQL Version 10.1.9-MariaDB
MySQL Packet Size 1.00 MB

Live Forum
Server Type Linux
Web Server Apache
PHP 5.6.16
MySQL Version 5.6.28
MySQL Packet Size 256.00 MB


All times are GMT. The time now is 01:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05317 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (20)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete