Page 1 of 1

Modifying the news block

Posted: 13. July 2010 12:56
by hooplah
Hello, I want to change the layout of the extended news block to look like this.

Image

I figure that a post like this

Code: Select all

[img]http://www.lovereading.co.uk/books/covers/imported/9780575095526.jpg[/img]

[b]By Midnight: A Ravenwood Mystery[/b]

July 2010 Debut of the Month.

 

Welcome to a stunning debut and a rollercoaster emotional ride of anger, mystery, fear and romance.  This is a spooky, London-based debut Young Adult novel that cleverly intertwines Highgate cemetery, still haunted from sightings of vampires back in the 1960s and Ravenwood, an exclusive Highgate School where vampires just might lurk in the shadows.  It’s a must-read vampire story that puts the world of Edward and Bella in the shade. Why not also take a peek at the other Gollancz Young Adult titles that have helped to launch this fierce and feisty new imprint.


I could just add two variables, say $left_topic_data and $right_topic_data.

I could then put in a while statement to make $left_topic_data= the topic until the data = the [/img] then $right_topic_data = topic and display the results using these variables.

Is this a good way to do it and how do I implement the changes.

Thanks ;)

Re: Modifying the news block

Posted: 13. July 2010 15:28
by Marc
Why don't you just add a table-bbcode with no borders? Then you would just create a 2 by 1 table and put the image in the left part and the rest in the right part? I'm sure there is something like that available on the internet.

Re: Modifying the news block

Posted: 13. July 2010 20:11
by hooplah
Thanks Marc, would it not require someone to click something to generate the bbcode as I am looking for a solution that requires no moddification to the initial posted topic and is automated thanks ;)

Re: Modifying the news block

Posted: 7. August 2010 11:25
by hooplah
Could someone help with the phpbb way to format this code please?

Code: Select all

//$query = "SELECT * FROM phpbb_posts"; 
	 
//$result = mysql_query($query) or die(mysql_error());


while($row = mysql_fetch_array($result)){
	$rawdata = $row['post_text']. " - ". $row['post_id'];
	$dataChunks = explode("[/img", $rawdata); 
	$string_one = "$dataChunks[0][/img]<br />";
	 $stringtwo = $row['post_text']. " - ". $row['post_id'];
	
}

mysql_free_result( $result );
I think it's something like this

Code: Select all

$sqls  = "SELECT * FROM phpbb_posts";

$results1 = $db->sql_query($sqls);

while($list = $db->sql_fetchrow($results1))
  {
	$template->assign_block_vars('data_row', array(

		'RAWDATA'				=> $row['post_text']. " - ". $row['post_id'],
        'DATACHUNKS'			=> explode("[/img", $rawdata),
        'STRINGONE'             => "$dataChunks[0][/img]<br />",
		'STRINGTWO'             => $row['post_text']. " - ". $row['post_id']
		)
	);
  }


$db->sql_freeresult($result1);;
but needs tweeking.

Many Thanks ;)