Forum Index   -   Topic Index
   Modules
     bulletin + ajaxblock
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
plusangel
Posted on: 2007/3/21 18:34
Home away from home
Joined: 2006/3/8
From: Athens, Greece
Posts: 237
bulletin + ajaxblock
Dear friends,

The last days we had a talk with Nuno about a bunch of interesting xoopsCube matters.

One of them was the usage of ajaxblock. I proposed to try make ajaxblock work with bulletin module instead news, as an alternative case.

I followed the above procedure. At the end you will find a link to download a zipped packet containing all the required files,

Get it, use it and come back to improve it. Please try it at home first ;)

(i mean locally)


The procedure:

- Install ajaxblock module (classic steps)

- Copy to your theme's folder the following files:

XOOPS_URL/themes/your_theme/ajaxtabs.css
XOOPS_URL/themes/your_theme/ajaxtabs.js

and

XOOPS_URL/themes/your_theme/images/shade.gif
XOOPS_URL/themes/your_theme/images/shadeactive.gif

- Edit your theme.html by adding the following lines

<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_imageurl}>ajaxtabs.css" />
<script type="text/javascript" src="<{$xoops_imageurl}>ajaxtabs.js"></script>


- Now, we have to change all the relative paths from news module to bulletin module (inside the XOOPS_ROOT_PATH/modules/ajaxblock/block_ajax.php file). Inside the modified bulletin-ajaxblock packet you will find the working version.

- Edit XOOPS_TRUST_PATH/modules/bulletin/class/bulletin.php

require_once "$mytrustdirpath/class/relation.php";
require_once "$mytrustdirpath/class/bulletinTopic.php";

to:

require_once XOOPS_TRUST_PATH."/modules/bulletin/class/relation.php";
require_once XOOPS_TRUST_PATH."/modules/bulletin/class/bulletinTopic.php";


- Edit XOOPS_ROOT_PATH/modules/ajaxblock/block/block_ajax.php
comment-out the align part sicne I couldn't find the corresponding variable in bulletin's sql code.

/*if ($myrow['topicalign'] == "L") {
	$align = "left";
} else {
	$align = "right";
}*/


- And set $image to 1 in

$news['hometext'] = $myts->displayTarea($myrow['hometext'], $html=1, $smiley=0, $xcode=1, $image=1, $br=0);

so that you can show images inside the articles.

In addition, inside the zipped ajax-block packet you will find the correct English translation thanks to Gigamaster and xoopserver!


----------------
Regards Angelos,

xoopsCube.gr, the greek support site!

gigamaster
Posted on: 2007/3/22 2:10
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock
Hi Angelos,

Thanks. I get it and i'm going to test with bulletin.

Best Regards,


----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

gigamaster
Posted on: 2007/4/21 16:23
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock : Block Template
Review template and CSS

.../modules/ajaxblock/templates/block/block_ajax.html

<!--bulletin compatibility by plusangel[at]xoopsCube.gr -->
<div id="maintab">
<ul id="shadetabs">
<li class="selected"><a href="#default" rel="ajaxcontentarea">news</a></li>
<{foreach name=i item=menu from=$block.menu}>
<li><a href="<{$xoops_url}><{$menu.item}>" rel="ajaxcontentarea"><{$menu.title}></a></li> 
<{/foreach}>

</ul>
</div>

<div id="ajaxcontentarea" class="contentstyle">

<table>
<tr>
<td>
<{foreach name=i item=news from=$block.stories}>
<{if $smarty.foreach.i.iteration == 1}>
		
<div class="item">
<div class="itemHead"><span class="itemTitle">
<span class="itemTitle">
<a href="<{$xoops_url}>/modules/bulletin/article.php?storyid=<{$news.id}>"><{$news.title}></a>
<a href="<{$xoops_url}>/modules/bulletin/index.php?page=article.php&storyid=<{$news.id}>">
<{$news.title}>
</a>
</span>
</div>
				
<div class="itemInfo">
<span class="itemPostDate"><{$lang_on}><{$news.date}></span>
(<span class="itemStats"><{$news.hits}> <{$lang_reads}></span>)
</div>

<div class="itemBody">
<{$news.topic_imgurl}>
<p class="itemText"><{$news.hometext}></p>
<div align="right"><{$news.readmore}>&nbsp;&nbsp;</div>
</div>

</div>
			
<{/if}>
<{/foreach}>

  </td>
  <td>
			
<ul id="ajaxlistnews">	

<{foreach name=i item=news from=$block.stories}>
<li>
<a href="<{$xoops_url}>/modules/bulletin/index.php?page=article&storyid=<{$news.id}>">
<{$news.title}></a>&nbsp;(<{$news.date}>)
</li>			
<{/foreach}>

</ul>

   <td>
  </tr>
</table>

<script type="text/javascript">
//Start Ajax tabs script for UL with id="maintab" Separate multiple ids each with a comma.
	startajaxtabs("maintab")
</script>
</div>



----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

gigamaster
Posted on: 2007/4/21 16:29
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock : Ajaxtabs CSS
Place ajaxtabs.css on your theme folder:

.../themename/ajaxtabs.css

And add ajaxtabs.css to your theme.htm header

<link rel="stylesheet" type="text/css" title="ajaxtabs" href="<{$xoops_imageurl}>ajaxtabs.css" />


ul#ajaxlistnews {
background-color:#ebebeb;
font-size:0.9em;
display:block;
width:180px;
height:auto;
overflow:hidden;
padding:7px;
}

ul#shadetabs {
	padding: 2px 0;
	margin-left: 0;
	margin-top: 2px;
	margin-bottom: 0;
	font: bold Verdana;
	list-style-type: none;
	text-align: left; /*set to left, center, or right to align the menu as desired*/
}

ul#shadetabs li {
	display: inline;
	margin: 0px;;
	padding:0px;
}

ul#shadetabs li a {
	text-decoration: none;
	padding: 2px 8px;
	border: 1px solid #ebebeb;
	background:#ebebeb url(images/bg_tab2.gif) 0px 0px repeat-x;
}

u#shadetabs li a:visited {
	background:#996600;
}

ul#shadetabs li a:hover {
	background:#ebebeb url(images/bg_tab2.gif) 0px -18px repeat-x;
}


ul#shadetabs li.selected {
	top: 1px;

}

ul#shadetabs li.selected a { /*selected main tab style */
	background:#ebebeb url(images/bg_tab2.gif) 0px -18px repeat-x;
	border-bottom-color: white;
}

ul#shadetabs li.selected a:hover { /*selected main tab style */
	text-decoration: none;
}


.contentstyle {
	border: 1px solid #ebebeb;
	padding: 5px;
	background:#FFFFFF;
}


Critics and suggestions are welcome!


----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

gigamaster
Posted on: 2007/5/4 2:18
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock : Ajaxtabs CSS
Bug on news title link.

Modify template above !


----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

plusangel
Posted on: 2007/5/4 17:49
Home away from home
Joined: 2006/3/8
From: Athens, Greece
Posts: 237
Re: bulletin + ajaxblock : Ajaxtabs CSS
Nice job, Nuno!

...always active!


----------------
Regards Angelos,

xoopsCube.gr, the greek support site!

OneOfTen
Posted on: 2007/8/19 22:05
Just can't stay away
Joined: 2005/12/31
From: Germany
Posts: 118
Re: bulletin + ajaxblock : Ajaxtabs CSS
I got the tiny problem that the pic 'loading.gif' while loading the content of a new tab is not displayed. Problem is in Firefox and IE 6/7, so must be a problem with my installation. Any idea?


----------------
[b][size=small][font=Verdana]Co-Admin on Xoopscube.org

gigamaster
Posted on: 2007/8/20 2:50
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock : Ajaxtabs CSS
Hi,

If it's only the loading animation that is missing,
check the image url on the file "ajaxtabs.js":

var loadstatustext="<center><img src='yourFolder/images/loading.gif' /><p> Now Loading ...</p></center>"


Have Fun!


----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

OneOfTen
Posted on: 2007/8/20 20:37
Just can't stay away
Joined: 2005/12/31
From: Germany
Posts: 118
Re: bulletin + ajaxblock : Ajaxtabs CSS
Hi,

I already did that and everything seemde ok. Now I tried some other paths and different pics but nothing worked.


----------------
[b][size=small][font=Verdana]Co-Admin on Xoopscube.org

gigamaster
Posted on: 2007/8/20 21:44
Home away from home
Joined: 2005/12/30
From: Switzerland
Posts: 1227
Re: bulletin + ajaxblock : Ajaxtabs CSS
Hi,

That means the problem happen a step before...
Maybe your theme is missing the link to ajaxtabs.js
Check the code source of your rendered page.


----------------
Xoops Cube Support

MAC OSX - Apache 2.2 - MySQL 5.5 - PHP 5.3
Free BSD - Apache 2.2 - MySQL 5.5 - PHP 5.2

(1) 2 »
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 

Who's Online
22 user(s) are online (11 user(s) are browsing Forums)

Members: 0
Guests: 22

more...

Welcome | News | Overview | Documentation | Forum | Tutorialstop
Brasilian | French | German | Greek | Japanese | Korean | Russian | T-Chinese
Powered by XOOPS Cube © 2001-2011 The XOOPS Cube Project