Comments

BenK’s picture

Now that we're approaching the D7 beta release, are there any plans to work on the Drupal 7 port sometime soon?

Thanks,
Ben

BenK’s picture

Now that we're approaching the D7 beta release, are there any plans to work on the Drupal 7 port sometime soon?

Thanks,
Ben

Taxoman’s picture

Hi, is there a D7 port underway? If so, is there a time frame for that?

SeeSchloss’s picture

Well there's a port underway, but there's no timeframe for anything. Given than I'm departing in two weeks for a remote island where I'll have next to no internet access (and I'll stay there until beginning of 2012). I just hope it will be done before I have to go, otherwise... well, I'll see.

naheemsays’s picture

Since it has been over two weeks, I assume its too late for your update to be completed?

Is it possible to have a patch or something uploaded here for others to work on?

daphisto’s picture

subscribe

culfin’s picture

subscribing as well

bacchus101’s picture

subscribing

Karsten.S’s picture

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

subscribe

danielm’s picture

subscribe

naheemsays’s picture

Title: Port to Drupal 7 » Port Tribune to Drupal 7
StatusFileSize
new79.44 KB

I've attempted upgrading both the 6.x-1.x version and the 6.x-3.x versions.

Bother are incomplete:

the 1.x version shows the text "array" instead of the page contents.

the 3.x version causes the database to crash.

I am uploading them both here with the hopes that someone else cna figure out what is wrong.

EDIT - just uploading the one as I seem to have deleted the 3.x version...

naheemsays’s picture

StatusFileSize
new49.13 KB

and the other one I found lying around - 6.x-3.x broken semi port attached.

kisugiai’s picture

StatusFileSize
new81.67 KB

Posted by nbz on February 26, 2011 at 1:01am I am uploading them both here with the hopes that someone else cna figure out what is wrong.

Well, i have picked up your version. i am not the realy php programmer ist so hard to convert with out a change doc.
i dont know what i realy do! ;)
so waht i have made
i have made

  • admin path to admin/config/user-interface/tribune
  • admin/help fixed
  • some db querey changed
  • blocks with string
  • some theme render canged and forms

waht not work

  • js does not realy work
  • admin filter config does not work realy because i get a wrong array
    if i have displayd the tables coreckt then does the save buttons not work
    without table the before slip only can enable
  • some filter wont work

wahst work

  • moderation
  • history
  • js shortcuts admin page
  • post in block and tribune
  • pager
  • feeds work xml
  • active user
  • filter nick user url

but look by your self
greetings feed back is wellcome

naheemsays’s picture

Has anyone got the js in this module to work?

I do have a slightly more cleaned up version of what is in post 13 (but not much more - it jsut fixes two errors) and the main problem is that the javascript does not work.

Any javascript gurus out there who know how to fix it?

kisugiai’s picture

not realy
the probem are the last "," in tribun.json.inc

	 foreach ($posts as $post) {
		$self = ($post->login && $post->login == $login);
//	 	$self = ($post['login'] && $post['login'] == $login);
		$contents .= tribune_get_json_post($post, $self);// . "," ;
//	how deleting "," after last post
		$_tribune_current_post_id = -1;
	}

i'm not firm in Java so i don't know how
the "," have to delete after last post
if its not in the string it will work single.
so you can post, moderate one but if more then one post at the same time js will stop at this point.
if its in so js stop immediately at any action.

naheemsays’s picture

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

removing the ',' does not seem ti fix anything for me (I am looking around line 46).

That is php code and you can replace it with the following:

  $posts_array = array();
 if (sizeof($posts) > 0) foreach ($posts as $post) {
    $self = ($post->login && $post->login == $login);

    $posts_array[] = tribune_get_json_post($post, $self);

    $_tribune_current_post_id = -1;
  }
  
  $contents .= explode($posts_array, ',');

and this way there wont be a comma after the last tribune post.

shunting’s picture

Just wondering about the D7 port. I really want it for D7... Since tribune is twitter before there was twitter, really...

kisugiai’s picture

@NBZ
thx for response but first what for errors you have removed?
and second
the explode doesn't realy work
because we have a string (with firebug)

{ "time": "1321985712",  "help": [],  "posts": [{ "text": "<li class='tribune-post' ref='' id='post-2' login=''> <span class='tribune-first-clock' title='id=2'>00:00:00</span>  <span class='tribune-info' title='Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'>FF7.0<i>Win</i></span>  <span class='tribune-message' dir='ltr'>Alyx Vance&lt; muhh</span></li> ",
  "classes": "tribune-post",
  "ref": "",
  "login": "",
  "moderated": "0",
  "id": "2" }
, <-- this we have to removed but if follow a second post it have stay here and if the last it must removed again]}

here we have to remove the , for the last ].
the explode gives a "Array" back after message

i have changed the part to

<?php
	       if (sizeof($posts) > 0){
$posts_array = array();
$contents = '{ "time": "'. REQUEST_TIME .'"'.",\n".
              '  "help": '."[\n\n";
$contents .= "],".
               '  "posts": '."[\n";

foreach ($posts as $post) {
		$self = ($post->login && $post->login == $login);
		$contents .= tribune_get_json_post($post, $self). ",";
//	how deleting "," after last
		$_tribune_current_post_id = -1;
  $contents .= "]}";

	}
 $valu1 = str_replace ( ',]}', ']}', $contents ); // this deletes or repalces the last , after last post
 print str_replace ( ']}{', ',{', $valu1 ); // this replace the wrong ]} by ,{ and prints a correct string for JSON
}
?>

but it has a little makel it changes the text in box to if we have the same signs combination in a sentence but works almost ever

@shunting
yes i want it to but I am not so firm in php and java
at the moment i check it at my demopage http://drupal7.electricman.de/

naheemsays’s picture

Can you please upload the latest code you have?

I cant seem to get to where you are currently.

kisugiai’s picture

StatusFileSize
new82.31 KB

sure but its not cleaned up many comentings of codes in
the old code are still in but commented out
and the thing with the adminfilter is still existend

or shall I put it in one of my sandboxes?

naheemsays’s picture

StatusFileSize
new81.18 KB

I have made a few changes to the upload in comment #20:

1, slightly cleaned up function tribune_print_json_newposts in tribune.json.inc - but the json seems to be restricted to something like 20 posts, and once there are any more than that on the tribune (not just between refreshed, but in total), it seems to stop posting any more of the updates and the page requires a manual refresh. Not sure if this problem existed before.

2. deleted Drupal 6 update functions from tribune.install

3. cleaned up the comments in tribune.json.inc function tribune_get_json_post(), deleted commented out code in theme_tribune_page(), tribune_post_from_row(), theme_tribune_post().

4. fixed the error that was caused by the totoz filter.

A lot more still needs to be done yet though, but I guess this isa good new baseline to continue working on (I proabbly wont be doing any more today and I need confirmation if this has fixed issues or made them worse.)

kisugiai’s picture

fine! works grate at the moment.
the implode thats was i haven't think about x)

kisugiai’s picture

hm at the moment on my clients works the refresh if i active on page (i have seen your post on my side)
i think its a problem of an time out from the js.
is there a default time out in the code?
because you have a setting for time out.

<?php
  $form['tribune_idle_delay'] = array(
    '#type'           => 'textfield',
    '#title'          => t('Idle delay'),
    '#default_value'  => variable_get('tribune_idle_delay', 0),
    '#size'           => 3,
    '#maxlength'      => 3,
    '#description'    => t('The delay before the tribune stop automatically reloading when an user is inactive, in seconds (0 to disable idle mode).'),
  );
?>

not sure i don't have looked for

i have changes a little in the json.inc and removed the rest of comented out code

<?php
  if ($post->moderated and !user_access("moderate tribune")) {
    $contents .= '{ "text": "moderated",'."\n". // Added " "text": "moderated",'."\n". " so we dont get an Java error anymore
                 '  "moderated": "'. $post->moderated .'"'.",\n".
                 '  "id": "'. $post->id .'"'." }\n";
  }
?>

in the moment iam on the admin.filters.inc
there i have some trubble with the settings i have no idea at the moment whi he want save settings

naheemsays’s picture

or shall I put it in one of my sandboxes?

this would be a good idea in order to keep up with the code changes.

kisugiai’s picture

okay dosen't metter about the folder of sandbox
take

git clone --branch 7.x-1.x AlyxVance@git.drupal.org:sandbox/AlyxVance/1289936.git tribune
cd tribune

for cloneing

so the admin.filter.inc is very very confused

kisugiai’s picture

so the most things works now
was not works is totoz hover java not sure why
all was i have chaned ist commited in the sandbox
the menu.inc offset message is not fixed
admin filters compleetly changed it is not more displayd befor an after slip and has no table more
but all possible variants are in maybe thats has someone a another soulution
smilies not testet because i have the module not installed
tribune.install, tests, css and java filles not touched

greetings alyx

naheemsays’s picture

On what page do you get the menu offset message?

To get the relevant tabs on the tribune page, I have added the following into the menu under $items['tribune']:

$items['tribune/view'] = array(
    'file' => "tribune.page.inc",
    'title' => 'Tribune',
    'page callback' => 'tribune_page',
    'access arguments' => array('access tribune'),
    'weight' => -1,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

and for $items['tribune/history'], $items['tribune/info'] and $items['tribune/moderations'] I added the following:

'type' => MENU_LOCAL_TASK,

The post referencing and highlighting currently doesnt work either.

kisugiai’s picture

StatusFileSize
new82.77 KB

themenu offset i get in administrations area.

the second looks good but you don't realy need because the menu have it.

PS.: you can commit/push it

naheemsays’s picture

I dont know what the settings are on the sandbox, but I had to use anonymous git to checkout. I doubt I will be able to commit.

I dont have translation on and I dont see that menu error either.

naheemsays’s picture

@SeeSchloss - Is the newly committed port to drupal 7 ready to test or just an initial commit?

SeeSchloss’s picture

Not ready at all, it's all just the basic functions for now.

kisugiai’s picture

fine
have you very diffrents in? il check it later
may be it help the projekt wich i have maked
you can feel free to take it this its the version which i have runing on my demo page http://drupal7.electricman.de/

kisugiai’s picture

hm can you make ist php 5.2 compatible?

SeeSchloss’s picture

I won't make it compatible with PHP 5.2 which isn't supported anymore, and which lacks a lot of useful features.

kisugiai’s picture

that's shame
because i have only 5.2 php which works with temporaly memory increase
on php 5.3 i can't use 128mb memory

naheemsays’s picture

Is the march 12 nightly the latest code?

I am getting the following error when I test it:

Warning: Invalid argument supplied for foreach() in tribune_posts() (line 48 of C:\wamp\www\drupal-7\sites\all\modules\tribune\tribune\tribune.module).

SeeSchloss’s picture

Hmm... it should be the latest code indeed, this is probably a bug but I'm not able to investigate it now (not until april 20 or something, sorry).

shunting’s picture

AWESOME! Thank you. I love this module. It's utterly the best for live textual interaction.

naheemsays’s picture

I can see that a lot of work has been committed recently.

On a test site it all seems to work.

Good enough to risk on a live site? (considering that the current version on there is a hacked together version...)

A couple more questions:

1. will the filters make a return? the active users and the weather once was useful along with smileys
2. Will this stay node based or do you intend at some point to make it a field that can be added to any entity?

SeeSchloss’s picture

I believe it works good enough to use on a live site, except for a few things:

  • There is no upgrade path from 1.x or 2.x yet
  • It has not been tested on a live site, even by myself

Now to answer you questions, filters won't be supported the way they are now (I find the filter system very hacky even if it's easy to use) but I will at some point write a (sub-)module that integrates filters with tribunes.
And an entity field would probably be the best thing to do (though maybe less easy to use for less advanced site admins) but I'm not sure how to do it, and for now I prefer using my time on other things that seem more important to me (like a way to upgrade from lesser versions, filters, /nick functionality too, etc).

kisugiai’s picture

a question
do you need
value="58" data-username="Anonymous" data-clockindex="0" data-timestamp="20120522021708" data-user="0"
because it is not W3C valid
and found
value of attribute "id" invalid: "-" cannot start a name… <form action="/" method="post" id="-tribune-post-form" accept-charset="UTF-…

SeeSchloss’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
Priority: Minor » Major
Status: Active » Needs work

Actually, your points validate as HTML5, which is my target (as well as CSS3 for CSS). data- attributes are allowed in HTML5. I suppose I could change the function name to change the form id, though this looks to me like a problem on Drupal's side if it generates invalid form ids from private function names.

Well anyway, yes I need these data- attributes, and I use them because they are valid HTML5. The form id also passes HTML5 validation, but it's a bit ugly so I will change that.

naheemsays’s picture

StatusFileSize
new4.6 KB

ive hacked together a tribune field.

Hacked together meaning it works,but i dont know how or why. and it will need a lot of work and I suspect right now it only works for nodes (and reuses a lot of current code).

Something to look at for future direction - I used the current schema and added a field schema with minor adjustments/additions (i wasnt sure what the type column was for so I added an etype one)

I used the tutorial on http://www.figover.com/node/15

(ideally the module would provide an entity aswell as a field, so that you can have a tribune entity with a tribune field on it...)

naheemsays’s picture

oops, the above doesnt work.

I was testing a tribune node and not the field.

/facepalm

SeeSchloss’s picture

Version: 7.x-3.x-dev » 7.x-3.0-alpha1

So... I just released an alpha.

Alpha because I'm not completely satisfied with its current state, it lacks a few things that I would have liked for a first release (most importantly, a block display). But this has been going on for too long, so here it is.

naheemsays’s picture

Just updated ot latest nightly.

1. In the commit message you mention the potential use of jquery-appear. If I jut put it in a libraries folder will it work or are there more steps necessary?

2. On my site the blocks block the visibility of the tooltip messages (date of posts), is it possible to give them a higher z-index?

(3. potentially expand the tooltip message with "actions" such as send pm to user etc that will take you to the relevant place or the admin actions. probably dont want this to be loaded per post but once per page though, so all that would go out the window. just an idea that i had.)

SeeSchloss’s picture

Status: Needs work » Fixed

1. I don't think it would be enough, to be frank I'm just not sure. I tested it with a theme that includes jQuery appear itself.

2. Yeah that can't hurt, I just did it.

3. I'll have to make something like that I guess, but it's purely CSS and this kind of thing is the most likely to break depending on the theme used (like the segments connecting post references too...).

Anyway, now I think I'll close this generic issue.

Status: Fixed » Closed (fixed)

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