1
chrometuna
xoops code blocks and smarty
  • 2005/1/8 15:48

  • chrometuna

  • Just popping in

  • Posts: 67

  • Since: 2004/7/24


I am hoping that someone can help me out here, or give me a good push in the right direction....

I want to either modify, or build some blocks for my site.

But I am clueless here
I am using wfsection (Zmagazine version) for my news content.

Heres the code from the block that displays the sections articles (I think? Its hard to tell because block-naming is not consistant with whats used in the configuration or admin pages...some thing would be easier if terms where used consistantly throughout an entire module, or even all of xoops...such as "Topic" is NOT interchangable with "section"...but thats not what Im here to whine about today...)

<code><{foreach item=wfs from=$block.new}>
(<{$wfs.new}>) <a href="<{$xoops_url}>/modules/zmagazine/article.php?articleid=<{$wfs.id}>"><{$wfs.title}></a><br>
<{/foreach}></code>

So lets say I have four sections, and I want to make a block for EACH section (4 blocks) and in each block I want to display the four or five NEWEST articles from a section, with headlines (As links to the actual article) and the summeries to each of those articles.

These blocks will be either right or left center blocks.

So part of what I need is a list of the various smarty codes that will draw out the info that I want to display, and I need to know how to make the block display that info.

I am at a loss to figure this out on my own.

Cheers
tuna

2
Mithrandir
Re: xoops code blocks and smarty

Quote:
I need is a list of the various smarty codes that will draw out the info that I want to display

Basic misconception there. Smarty code does not draw out any info at all. You will have to have some PHP code beneath it to draw the data from the database and "assign" it to Smarty, so it can be used in a Smarty template.

Look at the current WF-Section blocks by looking at the files in the modules/wfsection/blocks directory as well as modules/wfsection/templates/blocks - and how they are registered in modules/wfsection/xoops_version.php

3
chrometuna
Re: xoops code blocks and smarty

Quote:

Mithrandir wrote:

Basic misconception there. Smarty code does not draw out any info at all. You will have to have some PHP code beneath it to draw the data from the database and "assign" it to Smarty, so it can be used in a Smarty template.

Look at the current WF-Section blocks by looking at the files in the modules/wfsection/blocks directory as well as modules/wfsection/templates/blocks - and how they are registered in modules/wfsection/xoops_version.php


OK, thanks for the nudge in that direction. I will go examine those files and see if my little brain can wrap around them for once.

What is the basic PHP code that would go queery the database?
As in, is there a simple easy to understand list of such code and commands that ijits like me could understand?

I *SHOULD* be able to figure this out just by looking at the blocks and templates, but my brain must be on vacation because it just isnt making sense to me.

Maybe Ive been smoking too much PHP?

Cheers
tuna

Login

Who's Online

196 user(s) are online (126 user(s) are browsing Support Forums)


Members: 0


Guests: 196


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits