【问题标题】:vbulletin plugin call valuevbulletin 插件调用值
【发布时间】:2014-08-15 13:21:05
【问题描述】:

我正在使用 vBulletin 中的插件。这个插件将镜像链接存储在数组中或类似的东西我不确定我真的想通过单独调用它来显示页面上的每个镜像链接。

插件中的代码如下:

{vb:var mirrorid=$i=1}

正在返回第一个镜像 id 值,即1;并且:

{vb:var mirror.link}

正在返回镜像链接的值。

如何直接返回所有镜像链接值或其他值?

我尝试例如 {vb:var mirror.link=$i=3} 显示第三个链接值,但对我不起作用。

【问题讨论】:

    标签: php vbulletin


    【解决方案1】:
    If you are using vb4 then you can loop through array in template like
    lets you have an array 
    $binaries = array( 
        0 => array( 
            'subject'    => 'Subject 1', 
            'binaryid'    => 1, 
            'groups'    => array('alt.binaries.teevee', 'alt.binaries.multimedia') `enter code here`
        ), 
        1 => array( 
            'subject'    => 'Subject 2', 
            'binaryid'    => 2, 
            'groups'    => array('alt.binaries.xvid') 
        ), 
    );  
    
    and in vb4 you can pass array to template by registering variable.Then in your template you can easily access array values like
    <vb:each from="binaries" value="binary">
        {vb:raw binary.subject}
        {vb:raw binary.binaryid}
    </vb:each>
    
    if you are using VB 3.8 the you can not loop through array, you have to pass single variable to template or you can loop array in your php plugin code
    

    【讨论】:

      猜你喜欢
      • 2011-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多