vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Statistics Modifications - vB Weekly Stats (https://vborg.vbsupport.ru/showthread.php?t=132061)

Greek Wizard 12-04-2006 02:55 AM

This is a nice hack, but I have a problem with it.

When you get the e-mail, it lists the new users on the bottom.

When you click on one of them, I assume their profile is supposed to load up, but insteasd you get an error:

vBulletin Message
This user has not registered and therefore does not have a profile to view.


The problem IMO is that the link goes to:

Code:

http://www.xxxxxxxx.com/forums/member.php?find=lastposter&f=4701
When it should be:

Code:

http://www.xxxxxxxx.com/forums/member.php?u=4701
lastposter&f=4701 would be the last post on Forum ID 4701, not user 4701

Anyways, I am sure it's an easy fix, I have not had a chance to look at it and see what needs to be changed, but I thought you should know.

Greek Wizard 12-04-2006 03:01 AM

Like i said, I naver had a chance to look.. but I knew it was easy to fix:

Open includes\cron\weeklystats.php

Find:

Code:

// Create a user list from $getregs
while ($reg = $vbulletin->db->fetch_array($getregs)) {
        $user_display .= " <A HREF=\"" .
                $forum_url .
                "/member.php?find=lastposter&f=" . $reg['userid'] .
                "\">" . $reg['username'] . "</A> | ";
}

Replace with:

Code:

// Create a user list from $getregs
while ($reg = $vbulletin->db->fetch_array($getregs)) {
        $user_display .= " <A HREF=\"" .
                $forum_url .
                "/member.php?u=" . $reg['userid'] .
                "\">" . $reg['username'] . "</A> | ";
}

Not tested, but should work

Jd19 12-06-2006 02:41 PM

Thanks, I'll include this in the next update!

Omranic 12-08-2006 03:58 PM

nice work

I have a problem with it: Style Replacement Variables are proccessed so some style features (customized style) doesn't appear & make the page disturbed.

Suggession: it's not hard to make this hack depends totally on templates & not to include designing code within prog. code, also it's will be nicer if it becomes fully phrased, also make the hack depends on forum encoding when sending mails, finally you can use vbmail instead of php mail function to get advannce of its features.

we can help any where.
note: don't forget the first problem.

thanks

Jd19 12-11-2006 02:00 PM

UPDATED Version: Fixed Link for above problem

SolidSnake, Please post a link to your stats so I can see what you mean about the template. I'm assuming the vbmail function doesn't support HTML so I've used my own. Does it? I started with the intention of using the template in the email but disregarded it for several reasons. I particularly like the way it looks right now without a lot of extra information to look at.

DementedMindz 12-12-2006 03:02 PM

very nice mod would be nice to see the html removed from the php file and the html code cleaned up a bit This page is not Valid XHTML 1.0 Transitional! Failed validation, 202 errors :surprised: im cleaning my php file up now of alot of the errors but there is alot. also mods like microstats dont work with this well

also is you look at the html code you have

<title>CodeCall Programming Forum - Weekly Stats</title>

that needs to be changed also

Jd19 12-12-2006 03:21 PM

How are you testing the HTML and I will correct the code? What is microstats???

DementedMindz 12-12-2006 03:24 PM

Quote:

Originally Posted by Jd19 (Post 1137154)
How are you testing the HTML and I will correct the code? What is microstats???


you can check all your html code on this page

http://validator.w3.org/

I have removed alot of errors so far im down to Failed validation, 32 errors so its not to bad so far. as for microstats its right here

https://vborg.vbsupport.ru/showthread.php?t=116027

Omranic 12-13-2006 03:25 AM

Jd19
Have a look here: http://www.phpkd.com/vb/index.php
& then have a look here: http://www.phpkd.com/vb/weeklystats.php

Understand me? :)

Allan 12-13-2006 09:43 PM

French language ;)

Translator: Sofia

The dman 12-13-2006 11:46 PM

Installed

Thank you for this great hack.:)

farooqaaa 12-14-2006 02:39 AM

Easily, HackOfTheMonth :)

Installed - Added to my forum. Good job!

DementedMindz 12-15-2006 10:17 PM

Jd19 any word when the corrections will be made and released?

DementedMindz 12-16-2006 12:26 AM

I have almost every error fixed except I still cant get it to show up for microstats and one other error in $from == "" because it has no value there for the form. I tried to change it and get a db error. other then that if that I cleaned the whole html code up.

Total666 12-16-2006 07:29 PM

Dumb question ? Sorry - so to let the members view the stats I should just make a link in the forum to http://www.XXXXXX.tv/forums/weeklystats.php , thnaks

neolab 12-16-2006 07:59 PM

Quote:

Originally Posted by Allan (Post 1138076)
French language ;)

Translator: Sofia

Bonjour

Dommage que la traduction porte que sur le panel d'administration, car le template comporte toujours toutes phrases en anglais :-(

Jd19 12-23-2006 08:22 PM

Quote:

Originally Posted by SolidSnake@GTI (Post 1137524)
Jd19
Have a look here: http://www.phpkd.com/vb/index.php
& then have a look here: http://www.phpkd.com/vb/weeklystats.php

Understand me? :)

The tables being backwards or just that you translated it?


Quote:

Originally Posted by DementedMindz (Post 1139448)
Jd19 any word when the corrections will be made and released?

I'll try to get all of the errors fixed soon. I have some time to work on it and for some reason I stopped getting emails when people reply to this thread...

Jd19 12-23-2006 08:24 PM

Quote:

Originally Posted by Total666 (Post 1139894)
Dumb question ? Sorry - so to let the members view the stats I should just make a link in the forum to http://www.XXXXXX.tv/forums/weeklystats.php , thnaks

Yes but you have to allow their groups to view it. By default, they should be able to view it already.

Cybershaolin 12-26-2006 01:21 PM

Stats page works but email page give me weird results:

This is what I get in my email:
Code:

Content-type: text/html; charset=iso-8859-1
From: myemail@myforum.com
Message-Id: <somenumbers here@myserver>
Date: Mon, 25 Dec 2006 1442 -0500 (EST)


<HTML>
<HEAD>
<TITLE>Weekly Stats</TITLE>
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<table border="0" width="100%" BGCOLOR="#465786" border=1>
<tr><td><font color="#FFFFFF"><center>Current Week Stats - 0 Days Total</center></FONT></td></tr></table>
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<TR BGCOLOR="#6e7a9a">
<td colspan="2">
<font color="#FFFFFF">Threads/Posts</font>
</td>
</tr>
<tr>
<td>
Number of <strong>Threads</strong> This Week:
</td><td>
0
</td>
</tr>
<tr BGCOLOR="#efefef">
<td>
Number of <strong>Posts</strong> This Week:
</td><td>
0
</td>
</tr>
<tr>
<td>
Most <strong>Viewed Thread</strong> Created This Week:
</td><td>


Jd19 12-26-2006 02:17 PM

It is showing you the HTML as ASCII. Do you have an HTML capable viewer?

Bolas 12-26-2006 02:34 PM

Me too.
I'm receiving mail throught GMAIL. -.-'



I see U are using
Code:

mail($email_to, $vbulletin->options['weasub'], $message, $headers);
to send mail. I think that are available some vb method to do that.



--------------------------------------
some minutes later...

Yes, it's available a function that uses rights methods.

Code:

function vbmail($toemail, $subject, $message, $notsubscription = false, $from = '', $uheaders = '', $username = '')
But I dunno if it correctly manages HTML format. I'm testing it.

Bolas 12-26-2006 03:50 PM

Ok, pay attention here.

I patched it using:

- vb method to send mail
- hooks change on-the-fly the Content-Type

Attached U will find:

new /includes/cron/weeklystats.php
new product-weeklystats.xml

@Jd19: U are free to use this patch on your next version

Total666 12-26-2006 09:08 PM

Quote:

Originally Posted by Bolas (Post 1145349)
Ok, pay attention here.

I patched it using:

- vb method to send mail
- hooks change on-the-fly the Content-Type

Attached U will find:

new /includes/cron/weeklystats.php
new product-weeklystats.xml


@Jd19: U are free to use this patch on your next version


I tried this and I get a blank screen on the weeklystats.php .. Total

Bolas 12-26-2006 09:29 PM

--> Put it in the CRON directory, not in the root of your forum.

I just patched the cron and the product itself (adding a simple plugin in it) to use the text/html as Content-Type.

If U got blank screen it's because you overwritten the front-end file in your root.

So:
1) re-install my product patched
2) upload again original files released by Jd19
3) overwrite my weeklystats.php in ROOT/includes/cron/

dina 12-28-2006 07:56 PM

I just noticed that it pulls out information from hidden forums as well (even if the user group cannot view the forum).
Can you add something to exclude forums as well as user groups?

For example, if you have a hidden moderation forum and there are more replied to a thread in that forum than any other forum on the board, the title of that topic will appear in the statistic. Which can be a bit embarrassing if you're discussing something that's not meant to be of public knowledge.

TheWhite 01-02-2007 02:56 AM

great

storpappa 01-11-2007 03:19 PM

Bolas thanks for the changes - great mod made better

Cybershaolin 01-11-2007 04:39 PM

Quote:

Originally Posted by Bolas (Post 1145495)
--> Put it in the CRON directory, not in the root of your forum.

I just patched the cron and the product itself (adding a simple plugin in it) to use the text/html as Content-Type.

If U got blank screen it's because you overwritten the front-end file in your root.

So:
1) re-install my product patched
2) upload again original files released by Jd19
3) overwrite my weeklystats.php in ROOT/includes/cron/


Hmmm I'd like to give it a try but I'm confused. You're saying to put the files in the CRON directory but you also say to re-upload the original files from Jd19!! This is where I'm lost.

I have the version made by Jd19 and as I said, I have a problem with the emails sent.

One of his files (weeklystats.php) is in the root so if I re-upload his files according to him, it should go in the root. But on your side your file goes in the CRON... Do we keep both files?

Anyhow, what are the correct steps for those who had the original hack? Should I remove the hack first and just use your files after? I am completely lost with the steps given. :confused:

Distance 01-15-2007 08:00 PM

Thanks!

Kanustep 01-16-2007 12:31 PM

The update cause my subscription e-mail confused, they are now like this:

Quote:

Caro member, the user respondeu ao T?pico subscrito por si com o t?tulo - Thread title - no f?rum de ForumDOMAIN. Este t?pico est? localizado em: http://www.domainurl.com Esta ? a mensagem: *************** Message*************** Este t?pico poder? ter mais respostas, mas para as receber necessita de visitar o f?rum. Atentamente, ******~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Para remover a subscri??o deste t?pico visite a p?gina: http://www.domainurl.com Para remover a subscri??o de todos os t?picos, visite: http://www.domainurl.com
This is confused to read, but is how it appears on my e-mails, after I disable WeeklyStats the e-mail are full formated with paragraphs and etc.

skoenig 01-18-2007 05:56 AM

Great mod. Very very useful for our moderators and myself.

FYI The most recent version does seem to cause all vB emails sent to be treated as HTML emails or to have all their carriage returs remapped...resulting in :

Dear skoenig, You are subscribed to the thread "Bluetooth Pairing Problems" by ReneeRoberts, there have been 1 post(s) to this thread, the last poster was Jackskid. http://domainurl.com These following posts were made to the thread: ************ Treo headset pairing http://domainurl.com /1989-bluetooth-pairing-problems-post8488.html#post8488 Posted by: Jackskid On: 01-17-2007 10:07 AM I had pairing problems with my Treo Headset also. This worked for me. Go to prefs>hands-free> then check always route call to hands-free. ---Quote (Originally by ReneeRoberts)--- It seems my original Palm Treo Bluetooth Headset won't stay properly.


~ Steph

FireFish 01-18-2007 11:04 PM

I just needed to uninstall this mod because it seemed that it was affecting my vB automated e-mails. They were lacking line breaks; once I disabled this mod, all was back to normal.

mack324 01-19-2007 09:18 PM

AHHHHHHHHHHHHHHHHHHHHHHHHHH

uploaded, when i try to get to forum i get

Fatal error: Cannot use string offset as an array in /home/*******/public_html/global.php(356) : eval()'d code on line 321

cupra 01-19-2007 09:51 PM

thx, good one - installd!

criscokid 01-21-2007 10:08 AM

Quote:

Originally Posted by skoenig (Post 1161966)
FYI The most recent version does seem to cause all vB emails sent to be treated as HTML emails or to have all their carriage returs remapped.

Read the thread for this mod I was looking forward to installing it... until I got to news that the latest version is causing problems with emails. Hopefully this'll get sorted soon... looking forward to installing.

skoenig 01-22-2007 04:09 AM

It's a great mod and well worth the effort. Just got a little buglet that I'm sure will get ironed out soon...

~ Steph

TheWhite 01-23-2007 04:55 AM

Serious BUG found i'm using VB 364 and while having version 140 installed i had NO problems with my general forum emails, in the last few days since i updated to version 150 all my forum email was being crunched or parsed for some reason after days and nights of uninstalling every single hack and backstepping anything that i might of altered i found out that the 150 update is causing this so i put back the 140 verion and everything is working at 100% can the author please look into it and comment about this???

Regards

stomph 01-23-2007 10:22 PM

This hack also garbled my standard emails that vb sends.

I traced it down to the plugin called 'replace Content-Type with text/html in headers'. If I understand correctly, it simply replaces 'text/plain' in all email-headers with 'text/html'. However, the content of the standard emails from vb are not HTML and so there is no formatting to apply and everything is just one line!

I deactivated the plugin.. and badabing: Emails are formatted correctly again as plaintext.
I ran the weekly cronjob and the Statusmail displayed correctly as text/html in my mailclient (kmail)??
I don't quite understand why.. maybe kmail checks for html-tags. Although it does say 'text/html' in the header.. however, it seems to work! :)

Exitilus 01-24-2007 07:43 PM

The fix for this is to Disable the only plugin that this Mod creates.

Realize that the e-mail will come showing all HTML so it won't be parsed.

skoenig 01-24-2007 07:50 PM

Fixed in v1.5
This is not an official fix and may not work for you. This is a general purpose fix for all HTML emails sent through Vb and has been tested on vB v3.6.2 with PHP 5xx

1. Go to the Plugin Manager
2. Search down to Product: Weekly Stats
3. Click: replace Content-Type with text/html in headers
4. Replace contents with:

PHP Code:

if (stristr($message,'<HTML>')){
$headers str_replace('text/plain','text/html',$headers);



Explanation
This patch searches the message body for <HTML>. If it finds it it then replaces the content type with the content type for HTML emails. It's not bullet proof and can be fooled but for most people it should work fine.

If you want a bullet proof solution specifically for Weekly Stats the following should work:

PHP Code:

if (stristr($subject,'SUBJECT OF YOUR WEEKLY STATS EMAIL HERE')){
$headers str_replace('text/plain','text/html',$headers);


This can be made more efficient using the stripos() function to return as soon as the fist occurrence of the string in etiher case is found.

I've also modded the original install with the primary general purpose fix above for those who want it.

This is not endorsed nor approved by the original authors but here for those who may need it. All the other usual disclaimers apply.

~ Steph
forum.treonauts.com


All times are GMT. The time now is 11:00 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.01562 seconds
  • Memory Usage 1,850KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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