Project:Block Refresh
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:aaron
Status:closed (fixed)

Issue Summary

Hi there,

i would really love to see this module working for version 6.x.
if í could help i would but i worry i do not have the necessary know how in coding such things.

thanks though

onk

Comments

#1

yeah, would be a nice module...

#2

Assigned to:Anonymous» aaron

i'll do this after i'm done writing this module

#3

sounds great.....thank you....

#4

fyi, it'll also be after the update of embedded media field, which itself will be another week or two.

#5

Aaeon - great - looking forward to this module!

#6

subscribe

#7

Me too waiting - thanks in advance.

#8

subscribe

#9

subscribe :) thx!

#10

subscribing

#11

I would also love to see this for 6.x.

I'm using ACL which makes block caching inactive, but none of my blocks will refresh unless I manually clear the cache which is a huge pain.

#12

subscribe

#13

Last night i rewrote some Code of this, so it works with Drupal 6.x. But i_ll give no guarantee.
An example is seen on
http://www.hazzardeur.de/

On the left side there's a random Number, refreshed every 15 Seconds. U can refresh it manually too.

This isn_t really a patch, just replace the old code by the new one.

edit: Please use the Attachment of #17.

AttachmentSize
block_refresh.tar_.gz 11.46 KB

#14

dunkelfuerst i just downloaded your module but it says that it's not compatible is there another way to install it ?

#15

Sry, i forgot to change the .info-file.

Simply edit the .info-file and change the version to 6 or download the updated package:

edit: Please use the Attachment of #17.

AttachmentSize
block_refresh.tar_.gz 11.46 KB

#16

Same thing i'm i missing something?

Block Refresh 6.x-1.x-dev Allows blocks to automatically refresh their content.
This version is incompatible with the 6.9 version of Drupal core.

#17

sry, i forgot a line

now it should work

sry for the inconvenience

AttachmentSize
block_refresh.tar_.gz 11.46 KB

#18

I've enabled the module configured it and tried to make a view block auto refreshable but nothing happened then i switched to manual refresh the icon appears but nothing change (i'm testing locally) i saw it on your website it's working pretty well. We need someone to test it maybe there's something wrong on my local server.

#19

Just tried it out.
Doesn't seem to work as expected.

I am using the Flag module to add/remove content from my favorites. I am also using a views block to display current users favorites.
I tried the manual refresh option and it didn't work.

#20

Seems to be a Problem with Views-Blocks. I'll try to fix it later this day/tomorrow.

#21

can't wait for it :p thanks dunkelfuerst

#22

Okay, i did a quick-n-dirty, but at least, it should work now with views-blocks, too.
I hope i didn't forget a line again. ;)

AttachmentSize
block_refresh_6.tar_.gz 11.51 KB

#23

It now works :)
Thanks a lot for the quick fix...

What I am trying to now do is integrate this with the Flag module so that whenever a user adds or removes a flag, it gets reflected in a view block on the same page as the node being flagged/unflagged.

The Flag module gives a handle to call a JS function whenever a flag is set/unset. I plan to do something like this:

When a user sets/unsets a flag, call Block Refresh's block_refresh_manual(div) function. But I am unsure what is the best way to pass the div argument.
Where is the block_refresh_add_button() function being called? Or what div do I have to pass to the block_refresh_manual(div) function?

#24

Look into the sourcecode of your site, where you can see the refreshing block. There'll be something like

$(document).ready(function() {
  _block_refresh_data['#block-block-1 .content'] = new block_refresh_data(30000, '/block_refresh/block/1');
  block_refresh_timer('#block-block-1 .content');  block_refresh_add_button('block-block-1', '/block_refresh/block/1', '#block-block-1 .content');
})

'#block-block-1 .content' is the div your are searching for. (it will have a different name)

So, i if you want to refresh the block by yourself(or by the flag-module) simply call

block_refresh('#block-block-1 .content');

, but with the name, which is given in your source. But make sure, that this is called AFTER the $(document).ready() has been called, otherwise it will not work.

#25

dunkelfuerst
Thanks, I got it working by calling this:

block_refresh_manual('block-views-<my-view-name>-block_1');

#26

Does it works with eg,

<?php
$block
= module_invoke(views, 'block', 'view', 'block_1');
print
$block['content'];
?>

? If not, Anyway to get it working with it? Thanks

#27

For some reason it's not working for me in 6.10

To test I created a custom block to display a random number in php...

I expected it to flash a different number in the block every 5 seconds but it does nothing.

The code is

<?php

echo rand(5, 15);
?>

I changed all my roles to access block refresh content but it doesnt refresh.

In fact in MSIE I get an error:

Line: 28
Char: 3
Error: '_block_refresh_data' is undefined
Code:0
URL: http://projectvibe.net/home

EDIT:
It works... I used the inner archive from the tar-gz file and it works instead of the outer one. Thanks!

#28

Has anyone been able to use block refresh and exposed filters together? have user defined filter that will refresh and keep the filter.

for me, every time it refreshes the filters are lost.

Idan

#29

I'm having trouble with getting the block refresh module to refresh a node.

I created a custom node that reads the xml file http://projectvibe.net/drupal_bridge/nowPlaying.xml. This xml file is updated every song change (usually takes 3-5 minutes for a new song to play).

My nowplaying block displays the information as a node on http://projectvibe.net/home/ (nowplaying block).

I have the nowplaying block to refresh every 10 seconds via the block refresh module. Theoretically it should read the xml file and display the updated info but block refresh just re-displays the old (cached) node. If you hit [F5] on the browser, it reads the xml file and displays the node/block properly.

Is there a way this module can be adjusted to read a fresh copy of the node (or any content) that's in the refreshing block instead of reading a cached copy?

Thanks,

Elliott

#30

@arbel:

Do you have a site, where i can test it? Seems that you need a module for saving the exposed filter(http://drupal.org/project/views_savefilter), but there's no D6.x -version. But maybe i'm just missing some info here. ;)

@erdubya:
How is your block provided? Do you use direct php or is the block produced by a module? In the latter case, maybe following comment is helpful:
http://drupal.org/node/309394#comment-1138899

#31

Hi,

Thanks for the help, I think the module is great.

Here's the link:

http://69.50.199.29/

you can use the exposed filter to change the node type and see that once it's refreshed it resets the filters.

on the exposed filter the setting to remember the filter is turned on.

Idan

#32

any ideas on how the refresh module can save the exposed filters?

#33

@dunkelfuerst I have a new problem. Fivestar doesn't show correctly with refresh.

I have custom code to display a changing node in a refreshing block. This node is a changing song (currently playing). At first everything appears correctly, specifically the fivestar module. Every time the block refreshes the song, the fivestar module doesn't display fully and is replaced by a drop down instead (perhaps the underlying voting api?).

To see for yourself, please go to http://projectvibe.net/home and notice the right sidebar with the refreshing song node and fivestar rating module. After refresh (manual or automatic) the fivestar disappears and is replaced by the dropdown.

Any suggestions on how this can be fixed?

#34

Usually this module works superb on my Drupal 6 installs, thank you. My problem is that I always use a combination of Drupal 6 and Menalto Gallery 2.3 bridged by the gallery module from http://drupal.org/project/gallery However as soon as the Block Refresh module is enabled the gallery navigation block totally disappears when going to an embedded gallery page.

My example is a german website: http://www.goetting.de/de/multimedia In the sidebar on the right there's a "Multimedia-Bereich" block which is the embedded gallery navigation. As soon as Block Refresh is enabled that block disappears.

#35

@erdubya:
http://dunkelfuerst.com/projekte/drupal-block-refresh-6x
I've updated some js, now fivestars should work. (needed to call Drupal.attachbehaviors())

sry for the delay

#36

I'd like to use the block refresh with flags, as described above. But I can not find this code

$(document).ready(function() {
  _block_refresh_data['#block-block-1 .content'] = new block_refresh_data(30000, '/block_refresh/block/1');
  block_refresh_timer('#block-block-1 .content');  block_refresh_add_button('block-block-1', '/block_refresh/block/1', '#block-block-1 .content');
})

when i'm using Panels 3, Block Refresh 6.x. Do they work together?

#37

Block Refresh refreshes the block with my Webform Report block in it, but the filter I set-up in webform_report.inc is ignored at the report disappears on a refresh. Any ideas?

I just realized that the $nid is changed to "block" from the node no. upon refreshing. Any idea why?

#38

Hi it works great in D6.
What about Pager in Views ?
When I click next page the view is going back to the first page after block refresh.
I cant view the other pages.
Any ideas ?

#39

I don't know if this will work for you, but I had a similar problem. I was using a "block" view and as soon as I clicked to go to page 2, the refresh kicked in and I was back to page 1. I went to the Administer Views page for that block and tried the "more" link in the block settings (remove the pager). I believe you get a message that says that "more" will link to the page view. So, I just created a page view of the same view, disabled Ajax on the page view, and added the pager.

Maybe you don't actually have to create a page view, but that's what I did and it worked (maybe default serves that purpose).

So, my block view of 10 items refreshes properly and there is a link to more beside it. The link takes me to a non-refreshing page view with a full or mini-pager. I can browse through the items without refresh.

Hope this helps.

#40

I noticed another issue, block refresh module is messing up faceted search block (even if it's not enabled for this block).

#41

A stable 6x release is much much needed. Please.

The latest tar is not working with blocks generated by Views 6.x-2.3 or later.

#42

not working with external links module too

#43

Hi there,

Got this working great on drupal 6 - thanks. Here's a curveball.

I am using MyTree theme. It does not work with this theme but I do not understand why.

When I change to Garland theme everything is great.

Would anyone know what part of a theme could stop this from working? I do know the block is definitely refreshing and that it is getting the new content, it is just not printing.

Thanks,
Carrie

#44

cazam - copy block.tpl.php file from garland to Your theme folder.

#45

you are a freakin legend
thank you infinity times

#46

in the end, if it helps anyone else, I had to change my theme's block.tpl.php to combine what I had with layout, with the functions of the garland theme one.

This was my new code:

<div class="Block">
    <div class="Block-tl"></div>
    <div class="Block-tr"></div>
    <div class="Block-bl"></div>
    <div class="Block-br"></div>
    <div class="Block-tc"></div>
    <div class="Block-bc"></div>
    <div class="Block-cl"></div>
    <div class="Block-cr"></div>
    <div class="Block-cc"></div>
    <div class="Block-body">

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">

<?php if (!empty($block->subject)): ?>
<div class="BlockHeader">
    <div class="l"></div>
    <div class="r"></div>
    <div class="header-tag-icon">
        <div class="t">
<?php echo $block->subject; ?>
</div>
    </div>
</div>   
<?php endif;?>

<div class="BlockContent">
    <div class="BlockContent-body">
  <div class="content"><?php print $block->content ?></div>
</div>
</div></div>


    </div>
</div>

and I also had to change block refresh module in block_refresh.module changed .content to .BlockContent in 2 instances.

It works!

Thanks

#47

Great! IT WORKS!!
Just found a bug? possibly related more to firefox, cause it works fine in firefox under win OSes, but doesn't refresh in ubuntu linux. Anyway, you should make this release official for 6.x, at least dev, so people could easily find this solution.
I'll make a link to this page at my blog, so there will be one more link to find this page.
Thank you!)

#48

I'm using the 6.x version and I'm getting awful lot of access denied messages in my server log because of block refresh. Does anyone know why? They look like this:

Oct 11 11:01:41 mydrupal: http://www.myhost.ext|1255248101|access denied|9x.1xx.xxx.xxx|http://www.myhost.ext/block_refresh/user/3||0||block_refresh/user/3
Oct 11 11:01:41 mydrupal: http://www.myhost.ext|1255248101|access denied|9x.1xx.xxx.xxx|http://www.myhost.extblock_refresh/views/tracker_block-block_1||0||block_refresh/views/tracker_block-block_1

#49

where can i download the latest release ?

#50

Hi!

Im trying to use this module at my drupal 6.13 but it doesnt work :(

I made custom block with php code which are printing new rocords from database. I need to refresh it in each 5 seconds.
After installation I set permission to this module for everybody and set in block configuration autorefresh and 5s.
Its also doesnt work with manual refresh.

Where is the problem?!

Thx

#51

Hi,

I tried to install the module (the code uploaded at #22), but on my Drupal 6.12 (with Garland theme) I was not able to have it working.

The blocks simply won't reload.

------ EDIT 1 ------
I tested the module with a block created through the "add block" of the drupal interface, and the reload works.
Instead, the reload doesn't work with blocks that come from external modules.
----------------------

------ EDIT 2 ------
This module looks for /block_refresh/block/ID (when a custom block is added in Drupal) and that pages exists and doesn't have additional HTML, just the block content.
Instead when refreshing blocks that come from external modules, the block refresh module looks for /block_refresh/module_name/ID but this URL leads to a "Page not found" error.

So I think this a bug related only to blocks that comes from external modules: does anyone know how to fix this?
----------------------

I will try to have a look at the code and understand where is the problem, it would be good to know if someone else with my same Drupal version was able to make it work!

Vito

#52

Hi again,

replying to myself, I found the solution to my problem. If you have the same issue, just add this code:

  if (module_invoke($block, 'block', 'view', $delta)) {
    $block = module_invoke($block, 'block', 'view', $delta);
    print $block['content'];
    exit();
  }

right at the beginning of the function block_refresh_block_content($block = NULL, $delta = NULL) at line 138.

This modification will make reloading work for all the blocks, even for the ones created by external modules.
Hope it helps,

Vito

#53

Thank you for the update! Hopefully dunkelfuerst will incorporate it into his repository so people don't have to hand-patch.

#54

Status:active» fixed

thanks @dunkelfuerst, @youkho, @paganwinter, @arbel, @erdubya and everyone else! i committed the module from dunkelfuerst and opened a branch for d6.

@dunkelfuerst: would you be interested in taking over the module or being a co-maintainer?

thanks,
aaron

#55

Version:5.x-1.x-dev» 6.x-1.x-dev

changing version

#56

Im using block refresh with Views among other things and it works as it should. However, my Blocks page shows the wrong template (Garland). Im using Garland as a administration theme and a custom one for the external web.

It is because of the (line 173):
init_theme();

So, everytime I want to reorder my blocks I have to manually comment out that line in block_refresh.module temporarily. Which kinda sucks. :)

Ive tried fixing the problem but have to little knowledge about that part of the Drupal API to have been successfull yet.

Is anyone else having this problem? Solve it?

#57

I was having an issue getting this module to work with 6.x and finally found the problem. You must have friendly URLs turned on for this module to work. Perhaps this is documented somewhere but I didn't see it and subsequently beat my head against the wall for a couple of days trying to get it to work. Perhaps a README with that requirement outlined would suffice? Thanks for the great module!

#58

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#59

Agogo. I too am having the same problem with the theme. I haven't tried to take a look inside yet. However, for me I find changing the administrative theme to the same as my site theme works to see the appropraite block list and is easier than editing the module.