1
Forlorndeeds
Writing or copying xoops code into another block don't work?

Hey, I was wondering if you can help me?
I'm trying to devolop a like an account menu for people who log on, and stuff.
I want like a sort of a hybird of blocks, borrow concepts from different other blocks.
But when I do. It all displays like..... written text, so I get all this code everywhere.
How do I get it to phrase XOOPS code?

Can someone help?
Check out my site: www.symbiotic-online.com/bra.php - You've got to register to see it though.
Any help, suggestions?

2
Forlorndeeds
Re: Writing or copying xoops code into another block don't work?

Bump! Can anyone help?
I even tried putting it into the theme itself, theme.html. But it does'nt work.
Can someone tell me how to switch XOOPS code on?

3
Dave_L
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/15 21:10

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I don't know what you mean by Xoops code. You would use HTML, PHP or Smarty, depending on the context.

Could you provide an example of the code you're trying to put into a block? A short example is best.

4
Forlorndeeds
Re: Writing or copying xoops code into another block don't work?

Okay. I use XOOPS 2.7, with IPM 1.7? (Latest One.)

Here's some of it:
<{if $block.view_popup == true}>target="_blank"<{/if}> href="<{$block.user_link}>"><{if $block.is_avatar}><img src=<{$block.avatar}>><{/if}></a><br>
&nbsp;<a href="<{$xoops_url}>/user.php"><{$xoops_uname}></a><br>
<br>
<b><img src="http://www.symbiotic-online.com//modules/news/images/arrow.gif" width="14" height="14">
Statistics</b><br>
<{$block.lang_sum}> <br>
<{$block.lang_most_online}> <br>
<{$block.lang_new_user}>&nbsp;<a <{if $block.view_popup == true}>target="_blank"<{/if}> href=<{$block.nuser_link}>><{$block.lang_new_uname}></a><br>
<{$block.lang_top_post}>&nbsp;<br>
<{$block.lang_top_topic}>&nbsp; </a><br>
-----------------------------

They were usable in other blocks, how do I make it useable in my own custom block?

5
Dave_L
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/15 23:09

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


One problem is that you can't use Smarty tags in a custom block (a block created through the Control Panel Blocks Administration page).

If you want that kind of info in a custom block, as opposed to a block associated with a module, I think the only way is to make the block's content type PHP, and then use PHP to do the database query to fetch the desired data and display it.

Alternatively, you could add a new block to the module that "owns" the data, i.e., "hack" the module. Then the block would have its own PHP code and associated Smarty template.

6
Forlorndeeds
Re: Writing or copying xoops code into another block don't work?

Hey, thanks for your reply.
What about hacking a modules block? Just change the template it works in, would that be alright?
Or would I have to create my own module block? Would that be hard to do?

Also, by saying by making PHP commands, how do you do this? Via Phpmyadmin?

Thanks for your help.

7
Dave_L
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/16 1:40

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Hacking an existing block would probably be easier than creating a new block, especially if you're not very familiar with how XOOPS modules are structured.

By making PHP commands, I just meant writing plain PHP code, as opposed to Smarty code. But if you're going to hack an existing module block, that may not be necessary.

8
jmass
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/16 1:46

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I believe the reason behind not being able to pass smarty template variables is the lack of templates being associated with it. If this is correct you could create a new module that basically just has associates templates. This module could then call info from what ever modules tables you wanted to code for.

Please correct me if I am wrong.

JMass

9
Forlorndeeds
Re: Writing or copying xoops code into another block don't work?

Hmmm.. Some of it is working, but here is how it is displayed:

Resized Image

-----

Like, everytime there is a link it stuffs up, like there is a missing braket? Can you look at the code?

Here it is:

<a ><{if $block.view_popup == true}>target="_blank"<{/if}>
href="<{$block.user_link}>"><{if $block.is_avatar}><img src=><{$block.avatar}>><{/if}></a><br>
<a href="../%3C%7B$xoops_url%7D%3E/user.php"><{$xoops_uname}></a><br>
<br>
<{$block.lang_lastvisit}> <br>
<{$block.lang_sum}> <br>
<a target="_blank" href=><{$block.vposts_link}>><{$block.lang_view_posts}></a>&nbsp;<br>
&nbsp;<a target="_blank" href=><{$block.vtopics_link}>><{$block.lang_view_topics}></a>
</p>
<p align="center"><img src="http://www.symbiotic-online.com/images/arrow.gif">
Statistics<br>
<{$block.lang_most_online}><br>
<{$block.lang_top_post}>&nbsp;<br>
<{$block.lang_users}> <br><{$block.lang_new_user}>&nbsp;<a ><{if $block.view_popup == true}>target="_blank"<{/if}> href=<{$block.nuser_link}>><{$block.lang_new_uname}></a>
<br>

10
Dave_L
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/16 13:59

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You have a bunch of syntax errors there. I don't have time right now to point all of them out.

Examples:

<a> - invalid tag

href="..." (don't leave out the quotes)

href=> - ?

Login

Who's Online

194 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 194


more...

Donat-O-Meter

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

Latest GitHub Commits