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)
-   -   Major Additions - Product Review Forums ? Research, Review & Compare Items (https://vborg.vbsupport.ru/showthread.php?t=269808)

Ted S 10-23-2014 04:56 AM

Yuck. I'll dig in shortly... sorry!

Haywire0311 10-23-2014 01:44 PM

Quote:

Originally Posted by Ted S (Post 2519816)
Yuck. I'll dig in shortly... sorry!

I figured out the 'j' after 'd' issue. It's due to the normalize special character function starting on line 1861.

PHP Code:

function normalize_str($str)
{
$invalid = array('?'=>'S''?'=>'s''?'=>'Dj''d'=>'dj''?'=>'Z''?'=>'z',
'C'=>'C''c'=>'c''C'=>'C''c'=>'c''?'=>'A''?'=>'A''?'=>'A''√'=>'A',
'?'=>'A''≈'=>'A''∆'=>'A''?'=>'C''?'=>'E''?'=>'E''+'=>'E''?'=>'E',
'?'=>'I''?'=>'I''?'=>'I''?'=>'I''?'=>'N''?'=>'O''?'=>'O''?'=>'O',
'?'=>'O''?'=>'O''?'=>'O''?'=>'U''⁄'=>'U''?'=>'U''?'=>'U''?'=>'Y',
'fi'=>'B''fl'=>'Ss''?'=>'a''?'=>'a''?'=>'a''?'=>'a''?'=>'a''?'=>'a',
'?'=>'a''?'=>'c''?'=>'e''?'=>'e''?'=>'e',  '?'=>'e''?'=>'i''?'=>'i',
'?'=>'i''?'=>'i'''=>'o''?'=>'n''?'=>'o''?'=>'o''?'=>'o''ı'=>'o',
'?'=>'o''?'=>'o''˘'=>'u''˙'=>'u''˚'=>'u''˝'=>'y',  '˝'=>'y''˛'=>'b',
'ˇ'=>'y''R'=>'R''r'=>'r'"`" => "'""?" => "'""?" => ",""`" => "'",
"?" => "'""?" => "\"""?" => "\"""?" => "'""â??" => "'""{" => "",
"~" => """?" => "-""?" => "'");
$str str_replace(array_keys($invalid), array_values($invalid), $str);
return 
$str;


You can see that the first line within the array calls for replacing d with dj. I fixed it by just getting rid of it.

Still doesn't work well with vBActivity but no a big deal. I'll just shut off vBActivity when I do the mass upload.

Thanks for trying to help me through it. Now, only if you could do that hard part for me and build out that Wants/Gots function ;)

Ted S 10-24-2014 02:12 AM

Quote:

Originally Posted by Haywire0311 (Post 2519855)
I figured out the 'j' after 'd' issue. It's due to the normalize special character function starting on line 1861.

PHP Code:

function normalize_str($str)
{
$invalid = array('?'=>'S''?'=>'s''–'=>'Dj''d'=>'dj''?'=>'Z''?'=>'z',
'C'=>'C''c'=>'c''C'=>'C''c'=>'c''?'=>'A''?'=>'A''?'=>'A''√'=>'A',
'ƒ'=>'A''≈'=>'A''∆'=>'A''?'=>'C''?'=>'E''…'=>'E''+'=>'E''?'=>'E',
'?'=>'I''?'=>'I''Œ'=>'I''œ'=>'I''—'=>'N''“'=>'O''”'=>'O''‘'=>'O',
'’'=>'O''?'=>'O''?'=>'O''Ÿ'=>'U''⁄'=>'U''€'=>'U''‹'=>'U''›'=>'Y',
'fi'=>'B''fl'=>'Ss''‡'=>'a''?'=>'a''‚'=>'a''„'=>'a''‰'=>'a''?'=>'a',
'?'=>'a''?'=>'c''?'=>'e''?'=>'e''?'=>'e',  '?'=>'e''?'=>'i''?'=>'i',
'?'=>'i''?'=>'i'''=>'o''?'=>'n''?'=>'o''?'=>'o''?'=>'o''ı'=>'o',
'ˆ'=>'o''?'=>'o''˘'=>'u''˙'=>'u''˚'=>'u''˝'=>'y',  '˝'=>'y''˛'=>'b',
'ˇ'=>'y''R'=>'R''r'=>'r'"`" => "'""?" => "'""?" => ",""`" => "'",
"?" => "'""?" => "\"""?" => "\"""?" => "'""â??" => "'""{" => "",
"~" => """?" => "-""?" => "'");
$str str_replace(array_keys($invalid), array_values($invalid), $str);
return 
$str;


You can see that the first line within the array calls for replacing d with dj. I fixed it by just getting rid of it.

Still doesn't work well with vBActivity but no a big deal. I'll just shut off vBActivity when I do the mass upload.

Thanks for trying to help me through it. Now, only if you could do that hard part for me and build out that Wants/Gots function ;)

Nice work!! Guess we know how often this gets used... lol.

Looking into vBa (any bug is a bad bug) and that other thing this weekend.

Ted S 10-24-2014 02:16 AM

Do you have any mods / addons that impact the activity system?

The line with the error is calling up the hook "threadfpdata_postsave" and I'd like to fix that less is impact the frontend features (which use the same build_post routine).

Haywire0311 10-24-2014 11:38 AM

Quote:

Originally Posted by Ted S (Post 2519898)
Do you have any mods / addons that impact the activity system?

The line with the error is calling up the hook "threadfpdata_postsave" and I'd like to fix that less is impact the frontend features (which use the same build_post routine).

The only one I can think of that has any effect on the activity system is the DragonByte vBActivty mod.

Also, I think I found another small bug that probably needs some kind of SQL script run to fix it. When importing about 1700 products, I realized I imported them all into the wrong category. So, I fixed the issue in the XML and then re-uploaded to overwrite the data with the correct categoryid. It overwrote the data and corrected the categoryid and category name. However, the category count in the style dropdown in both admincp and frontend show the incorrect count number. Not sure the correct SQL syntax to use to fix the category count number.

Edit: If you want access to admin on my site, let me know and I can send you a PM with the details.

Edit #2: Just fixed the incorrect count number. Went into one of the revised items in the category just to ensure everything was correct after re-upload. All data was fine. I re-saved the item record and the count fixed itself. So the XML import overwrite won't actually fix the count until you edit a record and save again.

Ted S 10-27-2014 02:13 AM

Suspect that addon is doing it (not a negative to the addon, it's just likely colliding between things). I'll take a look.

As for counts, that's an easy fix I'll add in along with the character mapping. Just has to recalc at the end of the import process.

Anything else strike you as off while I'm working on these tweaks?

Haywire0311 10-27-2014 10:37 AM

Quote:

Originally Posted by Ted S (Post 2520178)
Suspect that addon is doing it (not a negative to the addon, it's just likely colliding between things). I'll take a look.

As for counts, that's an easy fix I'll add in along with the character mapping. Just has to recalc at the end of the import process.

Anything else strike you as off while I'm working on these tweaks?

Just that there is no ability to add products to a wants/gots list :) Just kidding!

I really haven't found many other issues, just those bugs listed above at this point. The special character bug doesn't speak to the function not being used much. My site focuses around beer and there's tons of beers from all over the world that have funky names and characters. I think that's the only reason why I caught it and no one else did.

Sorry for pestering you with all these small tweaks. I'd do it myself but I'm really only good at reading and small tweaks to code. I'm not capable of building my own yet. Btw, great job on this mod! Love it compared to the other review mods out there. Quite a few functions that others are missing.

Morrus 11-12-2014 04:47 PM

So I revisited this to see if I could get it working the way I wanted it to. The post formatting issues I was having above I've decided to accept, and simply tell my users it's for a short unformatted comment rather than a full review.

The last thing I need to do is to add an extra field for external reviews, so users cna use it in a Metacritic kinda way. So here's what I did:

- I changed the "Your location" text to "Original Review Location", and added some verbiage to tell the user to enter the URL of the full review in that box, and a short summary in the main message area.

- All good so far. But I can't figure out which template I change to so that I can turn that into a link rather than plain text when the actual review is displayed. Ideally, what I plan to do is post a little icon, and link that to the entered URL. I figure that's an easy template edit if I can figure out which template I need to edit.

Morrus 11-12-2014 10:05 PM

Also, any idea why this code isn't working? I thought it was the same code I was using before, but reviews stick at the rating of the first review, and don't alter when new reviews are added.

Quote:

// if we're approved, update the product count & average review, and user's review count
if(!$vbulletin->options['prodforums_appreviews'])
{
$ratings = $db->query_first_slave("SELECT rating FROM "
. TABLE_PREFIX
. "pf_review WHERE productid = "
. $db->escape_string($vbulletin->GPC['productid']) );

$new_rating = (array_sum($ratings)/((count($ratings)*5))*100);

$db->query_write("UPDATE "
. TABLE_PREFIX
. "pf_product SET rating = "
. $new_rating
.", reviews = reviews + 1 WHERE productid = '"
. $db->escape_string($vbulletin->GPC['productid']) ."'");

}

Morrus 11-14-2014 12:23 PM

I got that code working (redid it - took the original averaging code and just applied a multiplier).

I haven't managed to figure out the location thing, though.

I have added a column to display the added date (which I've renamed release date). Only issue there is you have to use PHPMYADMIN to edit the dates after they are added, but it's doable. The main reason I wanted to do that was so I could add upcoming products, but have them not show a review link until the release date. I can't for the life of me figure out how I compare today's date to that date in a bulletin template conditional, though. I suspect it's not possible.

Here's where I am so far. It looks quite good, I think, though the code and templates are probably now a hideous mess:

http://www.enworld.org/forum/productforums.php


All times are GMT. The time now is 05:44 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.02600 seconds
  • Memory Usage 1,817KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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