Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 07 Jun 2011, 15:45
galerio's Avatar
galerio galerio is offline
 
Join Date: Feb 2011
How can I add plugin for class_block.php

I'm trying to add Gravatar images to forum's sidebar widget for my plugin "Gravatar as default avatar". Unfortunatly there is no hook in \includes\calss_block.php and I need to manually modify the code.

The plugin is really simple, if the avatar url is empty, then it calls the gravatar url.

Is there a way to do it via plugin and not with a manual edit? (I'm not asking the code, I just ask if there is a templete hook to use).

Last edited by galerio; 07 Jun 2011 at 15:55.
Reply With Quote
  #2  
Old 07 Jun 2011, 18:09
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Maybe parse_templates? If you go into debug mode, then all the hooks that are called on the page are listed on the bottom.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 07 Jun 2011, 20:47
galerio's Avatar
galerio galerio is offline
 
Join Date: Feb 2011
Thank you for the help, but it doesn't work.
I tell you what I need to do:

in file /includes/class_block.php at line 481 replace

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the first of the things I would like to transform in a plugin.
Then in file /includes/blog_functions.php at line 1219 replace the same code above with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then in file /includes/class_blog_response.php at line 426 replace with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then in file \includes\api\1\api_getnewtop.php at line 527 replace with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If this mod was only for me, then I wouldn't need to create plugins, but I would like to share it with a simple xml product to import.

Any chance to do it?
Reply With Quote
  #4  
Old 07 Jun 2011, 22:51
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Is your forum sideblock a php block? If so, just modify it in there. If it isn't a php block, then what type of block is it?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 08 Jun 2011, 09:17
galerio's Avatar
galerio galerio is offline
 
Join Date: Feb 2011
They are the standard widget for sidebar, you can only choose between Blog Entries, CMS Articles, Forum Threads, New Forum Posts. You can't modify the php in the control panel because they are called from a default template located at includes\block\. But the avatar images are controlled by the file \includes\calss_block.php.

Is there a way to make a xml product that can modifiy the files on server? Something like "search and replace" (and the undo option when someone uninstall the product)

Thanks
Reply With Quote
  #6  
Old 08 Jun 2011, 16:47
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
So you are trying to change the avatar in *any* block basically?

You cannot edit files through a product.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #7  
Old 08 Jun 2011, 17:17
galerio's Avatar
galerio galerio is offline
 
Join Date: Feb 2011
yes, I want to change avatar everywhere avatarurl is empty. Take a look at my forum 1e2.it/forum.
I' have aready done it on thread, memberlist, profile.
But now to do it on sidebar and on Blog I can't find a way other than manual edit.
Reply With Quote
  #8  
Old 08 Jun 2011, 17:31
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I don't think you will be able to do it without a code edit. I know you will need to edit \includes\api\1\api_getnewtop.php manually (I had to write a product to change the avatars on my site for the mobile app).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 15:49.

Layout Options | Width: Wide Color: