Fork me on GitHub

Search

Donat-O-Meter

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

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap By Captcha cell cent chronolabs CHUNG Clicks content CĂN demo docek download Dresses evden eve facebook Fat Food for free Gateway Google Guide herre Honeypot Human HỘ IP iPhone jQuery Law Legal List log Loss mobile module modules Monster new newbb news NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher RESIDENCE responsive review Rights rmcommon security Sentry Signatures Signed site Smartphone Smoking Solution Spam Studio tags tdmcreate template The Theme themes web weight Wishcraft xoops Xortify XPayment

New Users

Registering user

# 137911

mydarkglobe

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  |  Register To Post



#1 Posted on: 2010/8/30 9:30 How to hack about: one block with one template file,not share the same template file ??
Is there anyone knows:
How to make one block have one template file ,not share the same template file ??

Top

rtskoo
Joined:
2010/8/30 9:13
From CHINA
Group:
Registered Users
Posts: 5
(Show More) (Show Less)


#2 Posted on: 2010/8/30 9:51 Re: How to hack about: one block with one template file,not share the same template file ??
you can do it by checking the block id or block title
<{if $block.title=="block-name"}>
  <
div class="thisclass">
<{elseif 
$block.title=="blockname"}>
  <
div class="anotherclass">
<{/if}>


Top


xoopsthemes.com
Bleekk
Joined:
2002/12/14 9:13
From Vienna
Group:
Registered Users
Designer Group
Posts: 479
(Show More) (Show Less)


#3 Posted on: 2010/8/30 17:29 Re: How to hack about: one block with one template file,not share the same template file ??
Thanks. But I have set the $block.title null, so I cannot use it in "IF". $block.id can be used.
Is there any better way without "IF" in template file?

Top

rtskoo
Joined:
2010/8/30 9:13
From CHINA
Group:
Registered Users
Posts: 5
(Show More) (Show Less)


#4 Posted on: 2010/8/30 17:45 Re: How to hack about: one block with one template file,not share the same template file ??
hmm you can ad a counter in the foreach loop so you will get for each block listed a new class
something like this
<div class="something<{counter}>">

result:
<div class="something0">
<
div class="something1">
<
div class="something2">
<
div class="something3">


Top


xoopsthemes.com
Bleekk
Joined:
2002/12/14 9:13
From Vienna
Group:
Registered Users
Designer Group
Posts: 479
(Show More) (Show Less)


#5 Posted on: 2010/8/30 18:07 Re: How to hack about: one block with one template file,not share the same template file ??
good idea!thank u
but I need PHP code hacking the core so that I can use the template file in menu "System Configuration"->"Templates" which is empty berfore hack.Or other better way?
And I have try the module "Defacer".However it is for page,not for a block in the page.

Top

rtskoo
Joined:
2010/8/30 9:13
From CHINA
Group:
Registered Users
Posts: 5
(Show More) (Show Less)


#6 Posted on: 2010/8/30 18:25 Re: How to hack about: one block with one template file,not share the same template file ??
you are welcome.
sorry but I do not understand what you are trying to do. maybe you can explain it one more time for me

Top


xoopsthemes.com
Bleekk
Joined:
2002/12/14 9:13
From Vienna
Group:
Registered Users
Designer Group
Posts: 479
(Show More) (Show Less)


#7 Posted on: 2010/8/30 18:45 Re: How to hack about: one block with one template file,not share the same template file ??
We know that when a new block is cloned ,its template file is empty ,even saved after some code written in this empty template file . Because this new block shares the same template file with the old block.So how can we do to make this new block's template file usefull ? That means this new block's template file will be not empty after modify it,and it will take effect for the new block.

Top

rtskoo
Joined:
2010/8/30 9:13
From CHINA
Group:
Registered Users
Posts: 5
(Show More) (Show Less)


#8 Posted on: 2010/8/30 19:58 Re: How to hack about: one block with one template file,not share the same template file ??
sorry this is something complete different. i hope someone else can help you

Top


xoopsthemes.com
Bleekk
Joined:
2002/12/14 9:13
From Vienna
Group:
Registered Users
Designer Group
Posts: 479
(Show More) (Show Less)


#9 Posted on: 2010/8/31 1:42 Re: How to hack about: one block with one template file,not share the same template file ??
You want not a cloned block, but a changed copy of the block.
Check out the module tutorial on kaotik.biz, there is a section that deals with blocks.
Then edit the xoops_version file of your module and add a new block by duplicating the target block entries and giving it new names. Then go to the file where the original block function is defined and duplicate there also the code and rename the function. Duplicate also the template file with the new name.
Update the module.
You now have two blocks with the same function, yet different setup and templates.

Top


The art of asking questions.
ghia
Joined:
2008/7/3 14:19
From Belgium
Group:
Registered Users
Posts: 4946
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]