📄 forumtag.java
字号:
}
// Set the date and time of last visit to this forum
if( trackVisits ) {
js.setNextForumVisitDate(pageContext,cf.getID());
}
// Save the script variable so JSP author can access forum data
pageContext.setAttribute(id,this,PageContext.PAGE_SCOPE);
return EVAL_BODY_INCLUDE;
}
/**
* Set a flag indicating whether date and time of users last visit
* to this forum should be saved (Optional attribute).
*/
public final void setTrackVisits(String a)
{
if( a.equals("true") )
trackVisits=true;
}
/**
* Forum ID property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="forumid"/>
*
* @return String - forum ID
*/
public final String getForumid()
{
return "" + cf.getID();
}
/**
* Forum Description property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="description"/>
*
* @return String - forum Description
*/
public final String getDescription()
{
return cf.getDescription();
}
/**
* Forum MessageCount property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="messagecount"/>
*
* @return String - forum MessageCount
*/
public final String getMessagecount()
{
return "" + cf.getMessageCount();
}
/**
* Forum ThreadCount property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="threadcount"/>
*
* @return String - forum ThreadCount
*/
public final String getThreadcount()
{
return "" + cf.getThreadCount();
}
/**
* Forum Name property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="name"/>
*
* @return String - forum Name
*/
public final String getName()
{
return cf.getName();
}
/**
* Date and time of Forum CreationDate (integer) property which can be
* obtained by the JSP page using
* <jsp:getProperty name=<i>"id"</i> property="creationDate"/>
*
* @return date and time of Forum CreationDate as an integer
*/
public final String getCreationDate()
{
return "" + cf.getCreationDate().getTime();
}
/**
* Date and time of Forum ModifiedDate (integer) property which can be
* obtained by the JSP page using
* <jsp:getProperty name=<i>"id"</i> property="modifiedDate"/>
*
* @return date and time of Forum ModifiedDate as an integer
*/
public final String getModifiedDate()
{
return "" + cf.getModifiedDate().getTime();
}
/**
* Date and time Forum was last visited (integer) property which can be
* obtained by the JSP page using
* <jsp:getProperty name=<i>"id"</i> property="lastForumVisitDate"/>
*
* @return date and time of lastForumVisitDate as an integer
*/
public final String getLastForumVisitDate()
{
return "" + js.getLastForumVisitDate(cf,jr).getTime();
}
/**
* Next Forum ID property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="nextForumid"/>
*
* @return String - next forum ID
*/
public final String getNextForumid()
{
return "" + nextForumID;
}
/**
* Previous Forum ID property which can be obtained by the JSP page
* using <jsp:getProperty name=<i>"id"</i> property="prevForumid"/>
*
* @return String - previous forum ID
*/
public final String getPrevForumid()
{
return "" + prevForumID;
}
/**
* Used by ThreadLoopTag and ThreadTag to get current Forum
*
* @return Forum
*/
public final Forum getForum()
{
return cf;
}
/**
* Method used by the getYazdProperty tag to get an extended Forum
* property from the forum tag script variable.
*
* @return String - value of the property
*/
public final String getProperty(String name)
{
String tmp = cf.getProperty(name);
if( tmp != null )return tmp;
return "";
}
/**
* Method used by the setYazdProperty tag to set an extended Forum
* property from the forum tag script variable.
*/
public final void setProperty(String name, String value)
{
try {
cf.setProperty(name,value);
} catch(UnauthorizedException ue) {
}
}
/**
* Set the <b>id</b> of a <b>match</b> tag
*/
public final void setMatch(String mtch)
{
MatchTag fmt =
(MatchTag)pageContext.getAttribute(mtch,PageContext.PAGE_SCOPE);
if( fmt != null && fmt.getMatch() != null )
match = fmt.getMatch();
}
/**
* Set a different forum
*/
public final void changeForum(Forum apf)
{
cf = apf;
}
/**
* Determine if forum has new messages since users last visit.
*
* @return boolean - true or false
*/
public final boolean newMessages()
{
if( js.getLastForumVisitDate(cf,jr).getTime() <
cf.getModifiedDate().getTime() )
return true;
return false;
}
/**
* Determine if there is a forum preceding this one
*
* @return boolean - true or false
*/
public final boolean prevForum()
{
if( prevForumID > 0 )
return true;
return false;
}
/**
* Determine if there is a forum following this one
*
* @return boolean - true or false
*/
public final boolean nextForum()
{
if( nextForumID > 0 )
return true;
return false;
}
/**
* Remove the script variable after forum tag closed out
*/
public final void release()
{
if( id != null && id.length() > 0 )
pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -