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)
-   -   vBulletin Forum Sideblocks - Forum Sideblock - Recent Posts (with BBCodes parsed) (https://vborg.vbsupport.ru/showthread.php?t=321920)

MarkFL 02-23-2016 10:00 PM

Forum Sideblock - Recent Posts (with BBCodes parsed)
 
1 Attachment(s)
Overview:

This product, upon installation, creates a new forum block that will display the most recent posts (the entire content in a scrollable block) with BBCodes parsed, and gives you settings to control several aspects of this new forum block. The settings are divided into 3 main groups:

Forum Block Settings:

Maximum Height Of Forum Block: This allows you to set a maximum height for the total inner block content containing all of the posts. A vertical scrollbars is added as needed. The default value is 450.

Block Title: This allows you to set the displayed title of the forum block, without having to edit the forum block itself. It is recommended that you do not edit the title of the forum block in the Forum Block Manager because the uninstall code depends on the title being its original value in order to remove it. You may include the number of posts shown and the value of a defined phrase to be in the block title. For example, if I want the title of the block to be "MHB's 5 Most Recent Posts" (and I have chosen to display all of the most recent posts) then I would enter in this setting:

MHB's [POSTS] [PHRASE]

where "[POSTS]" will be replaced by the number of posts being displayed, and [PHRASE] will be replaced by either $vbphrase['markfl_recentposts_title'], which is set to "Most Recent Posts" or $vbphrase['markfl_recentpostsperthread_title'], which is set to "Most Recent Posts/Thread".

The default is "[POSTS] [PHRASE]".

Block Title CSS: This setting allows you to apply additional CSS to the forum block title. For example, if you wish for the title to be 25% larger and in red, you would enter:

font-size: 125%; color red

The default is blank.

If you wish to change any other aspect of the forum block (other than the title), then use the "Forum Block Manager" to do so.

Posts Settings:

Posts To Display: This setting allows you to decide whether all of the most recent posts (the number of which you set) will be displayed, or only the most recent post per thread. The default is "Only Most Recent Post Per Thread". If you change this setting once you have the product running, then I recommend you clear the system cache each time you change it.

Number Of Posts To Display: This allows you to decide how many posts will be displayed in the forum block, chosen as per the setting above. The default is 5 posts.

Maximum Height Of Posts: This allows you to set the maximum height (in px) of the post content block before a vertical scrollbar is introduced. The default is 120 px.

Thread Title Settings:

Maximum Thread Title Length: This allows you to set the maximum number of characters from the thread title that will be displayed.

Display Thread Icons?: Allows you to set whether thread icons will be displayed.

Display Thread Prefixes?: Allows you to set whether thread prefixes will be displayed.

Thread Title CSS: Allows you to apply additional CSS to the thread titles.

Each post consists of a header containing the post author's avatar on the left (links to their profile), and a link to the post within its thread (with a tooltip stating which forum the thread is in) with the date/time of the post beneath the link. Both the tooltip and the timestamp use phrasing. Below this header is the block containing the entire post content, with BBCodes parsed.

https://vborg.vbsupport.ru/attachmen...1&d=1456294125

Updates:

Version 1.01:
  • Attempt to address reported db error.

Version 1.02:
  • Fixed error where height of block was hard-coded.

Version 1.1:
  • Combined queries.
  • Custom templates used to render output.
  • All CSS stored in template.
  • Fixed error causing block not to be removed upon uninstall.

Note: To update to version 1.1, please uninstall any previous versions first and remove any forum blocks left behind, and then install version 1.1.

Version 1.2:
  • All templates cached.

Version 1.3:
  • Block PHP restored.

Compatibility:

Tested and working on VB 4.2.x and may work on all 4.x versions of vBulletin.

Backup/Warning:

This product does not alter your database, however it is always good practice to make regular backups and you should make a backup before installing ANY new mod.

As always, products are USE AT YOUR OWN RISK. I will provide support and do my best to help but no absolute guarantee is offered.

To Install:
  • Download and extract the attached .zip file.
  • Follow AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product.
  • Click on "Choose File" and browse to the product .xml file that was packaged in the .zip file.
  • Click "Import."
  • Configure the settings to your liking. Each setting has a detailed explanation of its use.

https://vborg.vbsupport.ru/attachmen...1&d=1456294125

Support for this product can be found here:

kerrghann 02-24-2016 11:27 PM

Attempted to use it. Ran into an error almost immediately upon attempted install.

Code:

Fatal error: Cannot use object of type mysqli_result as array in /*****/******/public_html/includes/adminfunctions_plugin.php(1201) : eval()'d code on line 20

Max Taxable 02-24-2016 11:33 PM

Quote:

Originally Posted by kerrghann (Post 2565541)
Attempted to use it. Ran into an error almost immediately upon attempted install.

Code:

Fatal error: Cannot use object of type mysqli_result as array in /*****/******/public_html/includes/adminfunctions_plugin.php(1201) : eval()'d code on line 20

Same here.

In Omnibus 02-25-2016 12:02 AM

3rd Time Is Not The Charm

Code:

Fatal error: Cannot use object of type mysqli_result as array in /home/*****/public_html/includes/adminfunctions_plugin.php(1201) : eval()'d code on line 20

MarkFL 02-25-2016 01:41 AM

I have attempted to address the reported db error, with version 1.01. Because I experienced no such issue, I can't say if it will work for those reporting an error. :)

Max Taxable 02-25-2016 01:50 AM

Quote:

Originally Posted by MarkFL (Post 2565546)
I have attempted to address the reported db error, with version 1.01. Because I experienced no such issue, I can't say if it will work for those reporting an error. :)

Success here.

Max Taxable 02-25-2016 01:58 AM

Quote:

You MUST enable the product in the settings before it will function.
There's no option to enable or disable in the new settings. It starts working immediately.

MarkFL 02-25-2016 02:05 AM

Quote:

Originally Posted by Max Taxable (Post 2565549)
There's no option to enable or disable in the new settings. It starts working immediately.

Yeah, I use a template for publishing products, and I neglected to edit that out. I will do so now...:)

Max Taxable 02-25-2016 02:07 AM

Also for Chrome and Firefox (But not IE) this causes really SLOW load times for the page the sidebar is on, if the block is not cached. Set the cache to the block to 0 to try this out. Default for the block is 60 minutes, and i noticed the hitch on first load, then again when i emptied the block cache. Then i set the block cache to 0 and I get the long load time, every time now.

Testing now with WPT so get details of what is the bottleneck.

Max Taxable 02-25-2016 02:09 AM

Annnnnd also i cannot get this block to be any taller, no matter what i do in settings.

Max Taxable 02-25-2016 02:11 AM

Here's the waterfall with this Mod enabled. I get a BIG hangup in first byte, the page source code modeling takes forever with this Mod on for FF and Chrome.

http://www.webpagetest.org/result/16...6DS/1/details/

MarkFL 02-25-2016 02:18 AM

Quote:

Originally Posted by Max Taxable (Post 2565552)
Annnnnd also i cannot get this block to be any taller, no matter what i do in settings.

Try it in your default style, maybe you have some CSS somewhere that's interfering.

Max Taxable 02-25-2016 02:21 AM

Quote:

Originally Posted by MarkFL (Post 2565554)
Try it in your default style, maybe you have some CSS somewhere that's interfering.

Yep I'd done that. No love No Joy.

MarkFL 02-25-2016 02:35 AM

Quote:

Originally Posted by Max Taxable (Post 2565555)
Yep I'd done that. No love No Joy.

I found the culprit...so you won't have to uninstall and re-install, go to your "Forum Blocks Manager" and edit the content as follows:

Locate the line:

PHP Code:

if ($vbulletin->options['markfl_rpfb_blockmaxheight']) 

And within the if block, replace the line of code there with:

PHP Code:

    $output .= ' style="max-height: ' $vbulletin->options['markfl_rpfb_blockmaxheight'] . 'px; overflow: auto;"'

I will update the product as well. :)

Max Taxable 02-25-2016 02:36 AM

I have the sidebar block this Mod generates, off for now until issues get resolved. Mod has potential and is a good idea but clearly needs a little more work.:D

Max Taxable 02-25-2016 02:43 AM

I encourage everyone to try this Mod and see if you can duplicate my results with block caching off. It doesn't break anything and can be turned off in the forum block manager easily.

It's the early testing that helps the devs, without us guinea pigs out here where would we be?

MarkFL 02-25-2016 02:50 AM

Quote:

Originally Posted by Max Taxable (Post 2565558)
I encourage everyone to try this Mod and see if you can duplicate my results with block caching off. It doesn't break anything and can be turned off in the forum block manager easily.

It's the early testing that helps the devs, without us guinea pigs out here where would we be?

I set the block to be cached for 60 minutes specifically because of the query needed to fetch the posts (like the intrinsic "Forum Threads" block). However, even with the caching off, and 15 posts set to display, several of which were huge and peppered with LaTeX by MathJax, I didn't experience a significant lag. :confused:

Max Taxable 02-25-2016 02:54 AM

Quote:

Originally Posted by MarkFL (Post 2565559)
I set the block to be cached for 60 minutes specifically because of the query needed to fetch the posts (like the intrinsic "Forum Threads" block). However, even with the caching off, and 15 posts set to display, several of which were huge and peppered with LaTeX by MathJax, I didn't experience a significant lag. :confused:

Caching doesn't affect load time with any other forum block. I have them all set to 0 and all fetching 30 threads and/or posts..

I turned off all other blocks except this one, and did extensive testing at WPT with all browsers available. The problem is real. I average 10-20 seconds FBT with this Mod on, and request #1 is over 20kb with this mod on vs 14kb with this mod off. But of course it ain't the kb's, it's the queries.

Max Taxable 02-25-2016 03:06 AM

I don't see this Mod working on the site in your signature. Is that the site?

MarkFL 02-25-2016 03:08 AM

There's only 1 query:

PHP Code:

$recent_posts $vbulletin->db->query_read("
    SELECT post.*, thread.title, thread.forumid, thread.prefixid, thread.iconid
    FROM " 
TABLE_PREFIX "post AS post
    INNER JOIN " 
TABLE_PREFIX "thread AS thread
    ON thread.threadid = post.threadid
    ORDER BY post.dateline DESC
"
); 

Information about the posts as well as the threads they inhabit are needed. If anyone sees how to make that query more efficient, I'm all ears. :)

MarkFL 02-25-2016 03:10 AM

Quote:

Originally Posted by Max Taxable (Post 2565562)
I don't see this Mod working on the site in your signature. Is that the site?

I have it working on our dev site, on the same server. I have brought this mod to the attention of my fellow staff there, and am waiting for a general consensus before going live with it.

Max Taxable 02-25-2016 03:13 AM

Quote:

Originally Posted by MarkFL (Post 2565563)
There's only 1 query:

PHP Code:

$recent_posts $vbulletin->db->query_read("
    SELECT post.*, thread.title, thread.forumid, thread.prefixid, thread.iconid
    FROM " 
TABLE_PREFIX "post AS post
    INNER JOIN " 
TABLE_PREFIX "thread AS thread
    ON thread.threadid = post.threadid
    ORDER BY post.dateline DESC
"
); 

Information about the posts as well as the threads they inhabit are needed. If anyone sees how to make that query more efficient, I'm all ears. :)

NOT the queries of the mod itself, the amount of queries the server has to do in order to create the executable file for the page source. For whatever reason, this mod greatly increases it.
Quote:

I have it working on our dev site, on the same server.
Would you mind sending me that link via PM?

Meanwhile, i can turn this back on at my live site, and you can go there and see what kind of "lag" you get, significant or not.:D

MarkFL 02-25-2016 03:25 AM

Quote:

Originally Posted by Max Taxable (Post 2565565)
NOT the queries of the mod itself, the amount of queries the server has to do in order to create the executable file for the page source. For whatever reason, this mod greatly increases it.

Hmmm...okay, perhaps I should look into rendering the HTML via a custom template rather than storing it all in the returned value of the eval'd code. I thought about that, but decided against it since it seemed to work. I appreciate all of your feedback, and I will render the output via a custom block template instead.

Quote:

Originally Posted by Max Taxable (Post 2565565)
Would you mind sending me that link via PM?

Sorry, we only allow senior staff on our site access to our dev site. If it were my decision alone, I would have no hesitation, but it's not solely up to me.

Quote:

Originally Posted by Max Taxable (Post 2565565)
Meanwhile, i can turn this back on at my live site, and you can go there and see what kind of "lag" you get, significant or not.:D

I will be glad to check, but I am hoping using a custom template will fix the FBT issue...I should be able to complete this within 24 hours. :)

And again, thank you for your testing and feedback, it is greatly appreciated and valuable! :up:

Max Taxable 02-25-2016 03:27 AM

Quote:

Originally Posted by MarkFL (Post 2565568)
I will be glad to check, but I am hoping using a custom template will fix the FBT issue...I should be able to complete this within 24 hours. :)

And again, thank you for your testing and feedback, it is greatly appreciated and valuable! :up:

Okay check it right quick - your mod is the only forum block i have running.

http://dallascowboysuniverse.com

MarkFL 02-25-2016 03:34 AM

Quote:

Originally Posted by Max Taxable (Post 2565570)
Okay check it right quick - your mod is the only forum block i have running.

http://dallascowboysuniverse.com

Yes, I counted a 16 second load time after the initial load and I refreshed the page.:eek:

It will be interesting to see if the custom template makes a positive difference. :)

Max Taxable 02-25-2016 03:35 AM

Okay I have set the default block active, yours back off.

Glad to be of help.

MarkFL 02-25-2016 07:08 AM

Update - Version 1.1:
  • Combined queries.
  • Custom templates used to render output.
  • All CSS stored in template.
  • Fixed error causing block not to be removed upon uninstall.

In Omnibus 02-25-2016 11:08 AM

The block is displaying twice with version 1.1.

Easily remedied by removing one of the blocks in the Forum Blocks Manager.

Page still loads excessively slowly.

MarkFL 02-25-2016 02:17 PM

Quote:

Originally Posted by ProSportsForums (Post 2565578)
The block is displaying twice with version 1.1.

Easily remedied by removing one of the blocks in the Forum Blocks Manager.

Page still loads excessively slowly.

I had an error in previous versions where the block wasn't removed from the db when you uninstall, so installing version 1.1 after uninstalling a previous version requires you to remove any remaining blocks that were installed. That's fixed now.

Please make sure you removed the old block instead of the new one. :)

Max Taxable 02-25-2016 03:13 PM

Okay to just upload the XML to overwrite?

MarkFL 02-25-2016 03:20 PM

Quote:

Originally Posted by Max Taxable (Post 2565587)
Okay to just upload the XML to overwrite?

The steps I recommend using to upgrade to version 1.1 are as follows:
  1. Uninstall old version.
  2. Delete any remaining forum blocks associated with this product that were left behind.
  3. Install new version.
  4. Reset your settings for this product.

Max Taxable 02-25-2016 03:23 PM

I did the uninstall, and got this:
HTML Code:

Fatal error: Cannot use object of type mysqli_result as array in /home/content/html/admincp/plugin.php(1558) : eval()'d code on line 5

MarkFL 02-25-2016 03:26 PM

Quote:

Originally Posted by Max Taxable (Post 2565589)
I did the uninstall, and got this:
HTML Code:

Fatal error: Cannot use object of type mysqli_result as array in /home/content/html/admincp/plugin.php(1558) : eval()'d code on line 5

Edit the product to remove the uninstall code, then uninstall, then remove any blocks this product left behind. Then install the new version. Sorry for the inconvenience.

Max Taxable 02-25-2016 03:33 PM

Annnnnd..... No forum sidebar block was created on new install.

MarkFL 02-25-2016 03:46 PM

Quote:

Originally Posted by Max Taxable (Post 2565591)
Annnnnd..... No forum sidebar block was created on new install.

I re-uploaded the product files to make sure I didn't make an error there...the install/uninstall works perfectly for me on both of my test sites.

Max Taxable 02-25-2016 04:12 PM

Quote:

Originally Posted by MarkFL (Post 2565593)
I re-uploaded the product files to make sure I didn't make an error there...the install/uninstall works perfectly for me on both of my test sites.

THAAAAAAT worked. Successful uninstall and successful re-install.

BUT...

As mentioned by someone else earlier, the mean old lag is still there - only on first load with the default 60 min. cache setting. But every time when it's not cached. I have set it at zero so you can see.

Also, no more vertical scrollbars? And a change to the CSS of the thread titles?

I have it live at previous link for your perusal.

MarkFL 02-25-2016 04:20 PM

The vertical scrollbars are still there...at least they are on my 2 test sites. Have you changed the script name for your forum home? I have the CSS only being rendered when the script name is "index".

Max Taxable 02-25-2016 04:26 PM

Quote:

Originally Posted by MarkFL (Post 2565595)
The vertical scrollbars are still there...at least they are on my 2 test sites. Have you changed the script name for your forum home? I have the CSS only being rendered when the script name is "index".

Nothing's changed on my site since the last version scrollbars worked.

EDIT: It's weird - I get the scrollbars in my custom mobile style, (styleID=63) but not in vB default style or any other of the desktop styles.

MarkFL 02-25-2016 04:30 PM

Quote:

Originally Posted by Max Taxable (Post 2565596)
Nothing's changed on my site since the last version scrollbars worked.

In the previous versions, the CSS was inline, but now it's in a template, which is only added when the script name is "index" since that's the only place the sidebar displays (unless you are using a product that displays it elsewhere).

Max Taxable 02-25-2016 04:31 PM

I've had to disable the block again, the lag is just murder.


All times are GMT. The time now is 06:20 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.02768 seconds
  • Memory Usage 1,871KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (24)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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