• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
      • Try XenForo Demo
      • New Posts
      • FAQ
      • Calendar
      • Community
        • Groups
        • Albums
        • Member List
      • Forum Actions
        • Mark Forums Read
      • Quick Links
        • Today's Posts
        • Who's Online
      • Sponsor
        • Sponsor a Feature
        • List of Donors
    • Wiki
    • Support
    • What's New?
    • Buy Now
    • Manual
    • 
    • Forum
    • VaultWiki How-Tos
    • VaultWiki Questions
    • Adding search box to custom front page

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Page 2 of 2 FirstFirst Previous 12
    Results 16 to 21 of 21

    Thread: Adding search box to custom front page

    • Thread Tools
      • Show Printable Version
    1. April 8, 2012 #16
      Lord Doys
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Lord Doys is offline
      Junior Member
      Join Date
      September 27, 2011
      Posts
      45
      Rep Power
      182
      Quote Originally Posted by Benjaminlwells View Post
      ah, perfect that did it! Now you've got me wondering how you made the block for recent wiki changes? Is it custom code, or did you use the preset to look at the namespace forum?
      its custom as well, ill dig up the code for you
      Reply With Quote Reply With Quote

    2. April 8, 2012 #17
      Lord Doys
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Lord Doys is offline
      Junior Member
      Join Date
      September 27, 2011
      Posts
      45
      Rep Power
      182
      create a block in the forums block manager (same as you did before)
      i called it: recent wiki changes
      php
      put the following code in the content.
      you probably have to replace ALL the text with vb3_ with your own prefix code of your vbulletin tables
      Code:
      global $db, $vbphrase, $threadinfo, $post, $stylevar, $show;
      
      $threads= $db->query_read_slave("
      SELECT thread.title, thread.forumid, thread.threadid, revision.revisionid, revision.reason as reason,
      	revision.dateline, revision.username as postusername, thread.lastpost AS threadlastpost, 
      	thread.lastposterid, forum.title_clean as forumtitle,  user.*, avatar.avatarpath, 
      	NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,
      	customavatar.width AS avwidth,customavatar.height AS avheight
      
      		FROM (
      select * from `vb3_vault_revision` order by dateline DESC
      )  AS revision
      LEFT JOIN vb3_thread AS thread ON (thread.threadid = revision.threadid)
      INNER JOIN vb3_forum AS forum ON(forum.forumid = thread.forumid)
      LEFT JOIN vb3_user AS user ON (user.userid = revision.userid)
      LEFT JOIN vb3_avatar AS avatar ON(avatar.avatarid = user.avatarid) 
      LEFT JOIN vb3_customavatar AS customavatar ON(customavatar.userid = user.userid)
      
      group by thread.title
      order by revision.dateline DESC
      
      LIMIT 10
      
      	");
      	
      	while ($thread = $this->registry->db->fetch_array($threads))
      			{
      //echo "title: ".$thread['title'] ."<br>";
      				// still need to censor the title
      				$thread['title'] = fetch_censored_text($thread['title']);
      				$thread['date'] = vbdate($this->registry->options['dateformat'], $thread['dateline'], true);
      				$thread['time'] = vbdate($this->registry->options['timeformat'], $thread['dateline']);
      
      				$thread['lastpostdate'] = vbdate($this->registry->options['dateformat'], $thread['threadlastpost'], true);
      				$thread['lastposttime'] = vbdate($this->registry->options['timeformat'], $thread['threadlastpost']);
      
      				// get avatar
      				$this->fetch_avatarinfo($thread);
      
      				$threadarray[$thread['threadid']] = $thread;
      			}
      
      			foreach ($threadarray as $key => $thread)
      			{
      			//echo "<br> - title: ". $threadarray[$key]['title'];
      				$threadarray[$key]['url'] = fetch_seo_url('thread', $thread);
      				$threadarray[$key]['newposturl'] = fetch_seo_url('thread', $thread, array('goto' => 'newpost'));
      				$threadarray[$key]['lastposturl'] = fetch_seo_url('thread', $thread, array('p' => $thread['lastpostid'])) .
      					'#post' . $thread['lastpostid'];
      				$threadarray[$key]['title'] = fetch_trimmed_title($thread['title'], $this->config['threads_titlemaxchars']);
      			}
      
      			$templater = vB_Template::create('block_wikichanges');
      				$templater->register('threads', $threadarray);
      			return $templater->render();
      
      $db->free_result($threads);
      	unset($threadarray );
      then create a new template in the style manager called: block_wikichanges
      with the following code

      Code:
      		<ul id="block_wikichanges_{vb:raw blockinfo.blockid}" >
      		
      			<vb:each from="threads" key="threadid" value="thread">
      			<li class="<vb:if condition="!$vboptions['avatarenabled']">no</vb:if>avatarcontent floatcontainer widget_post_bit">
      				<div class="widget_post_userinfo">
      				<vb:if condition="$vboptions['avatarenabled']">
      				<div class="cms_widget_post_useravatar widget_post_useravatar">
      					<a class="smallavatar comments_member_avatar_link" href="{vb:link member, {vb:raw thread}}">
      					<vb:if condition="$thread['showavatar']">
      					<img width="30" title="" src="{vb:raw thread.avatarurl}" alt=""/>
      					<vb:else />
      					<img width="30" title="" src="{vb:stylevar imgdir_misc}/unknown.gif" alt=""/>
      					</vb:if>
      					</a>
      				</div>
      				</vb:if>
      				</div>
      				<div class="smallavatartext widget_post_comment<vb:if condition="!$vboptions['avatarenabled']">_noavatar</vb:if>">
      					<h5 class="widget_post_header"><a href="{vb:raw thread.url}" class="title">{vb:raw thread.title}</a></h5>
      					<div class="meta">
      						<vb:if condition="$threadstype == 0">Edited by <a href="{vb:link member, {vb:raw thread}}">{vb:raw thread.postusername}</a> {vb:stylevar dirmark}<vb:if condition="$thread['reason']"><br />(Reason: {vb:raw thread.reason})</vb:if>
      						<br />{vb:raw thread.date}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.time}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
      						<vb:else />
      						{vb:rawphrase last_post_by} <a href="{vb:link member, {vb:raw thread}, null, 'lastposterid', 'lastposter'}">{vb:raw thread.lastposter}</a> {vb:stylevar dirmark}({vb:rawphrase x_replies, {vb:raw thread.replycount}})
      						<br />
      						{vb:raw thread.lastpostdate}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.lastposttime}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
      						</vb:if>
      					</div>
      				</div>
      			</li>
      			</vb:each>
      		</ul>
      then in the everywhere sidebar you can show hide it where ever you like

      that should do it
      Reply With Quote Reply With Quote

    3. April 8, 2012 #18
      Lord Doys
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Lord Doys is offline
      Junior Member
      Join Date
      September 27, 2011
      Posts
      45
      Rep Power
      182
      oh i put the cache time of the block on 60 minutes, so it doesnt run too often
      Reply With Quote Reply With Quote

    4. April 8, 2012 #19
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      That's a good idea, that query is expensive (it requires a full scan of a potentially large vault_revision table). If you break it up into two queries, you can perform the scan on a much smaller table.

      Code:
      SELECT lastmodified AS dateline FROM vb3_vault_article WHERE pending = 0
      Use the collected datelines to:
      Code:
      SELECT ... FROM vb3_vault_revision AS revision
      ...
      WHERE revision.dateline IN (collected_datelines)
      Hope this helps; this is essentially how we build the Recent Changes page to avoid massive scans.

      Also, if you can and know how to package product files, it would be great if you can release this as a mod in our modifications forum.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    5. April 8, 2012 #20
      Benjaminlwells
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Benjaminlwells is offline
      Junior Member
      Join Date
      March 16, 2012
      Posts
      7
      Rep Power
      0
      You guys rock. I'll play around with that tomorrow. I have my boy home from school for the Holiday, and my wife at work, so I might not get a chance to dig in, I'll let you know where I get with it!
      [SIGPIC][/SIGPIC]
      AlphaFlight.net - The Home for Alpha Flight Fans
      Reply With Quote Reply With Quote

    6. April 9, 2012 #21
      Lord Doys
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Lord Doys is offline
      Junior Member
      Join Date
      September 27, 2011
      Posts
      45
      Rep Power
      182
      Quote Originally Posted by pegasus View Post
      That's a good idea, that query is expensive (it requires a full scan of a potentially large vault_revision table). If you break it up into two queries, you can perform the scan on a much smaller table.

      Code:
      SELECT lastmodified AS dateline FROM vb3_vault_article WHERE pending = 0
      Use the collected datelines to:
      Code:
      SELECT ... FROM vb3_vault_revision AS revision
      ...
      WHERE revision.dateline IN (collected_datelines)
      Hope this helps; this is essentially how we build the Recent Changes page to avoid massive scans.

      Also, if you can and know how to package product files, it would be great if you can release this as a mod in our modifications forum.
      cheers, ill play with it. dont forget i am just a homebrewprogrammer.. normally i tell people what to do

      as for the packaging, i do recall asking you about it a while ago if there were some kind of guidelines for doing so for VW.
      Ill see what i can do
      Reply With Quote Reply With Quote

    Page 2 of 2 FirstFirst Previous 12

    Similar Threads

    1. How to get front page A-z index like NuWiki ?
      By Jules in forum VaultWiki Questions
      Replies: 5
      Last Post: April 4, 2012, 4:39 PM
    2. [Miscellaneous Hacks] Newest Wiki pages link, in Forumhome, and in Wiki front page
      By basketmen in forum vBulletin 3.x Addons
      Replies: 5
      Last Post: July 27, 2011, 4:45 AM
    3. Add 'New pages' and 'New pages' content to wiki front page
      By basketmen in forum VaultWiki Questions
      Replies: 6
      Last Post: July 20, 2011, 10:55 PM
    4. issue with Google Custom search engine results
      By mickknutson in forum General Discussion
      Replies: 1
      Last Post: July 10, 2011, 1:15 PM
    5. Promote a wiki article to CMS front page
      By stev in forum General Discussion
      Replies: 6
      Last Post: December 7, 2010, 3:57 PM

    Bookmarks

    Bookmarks
    • Submit to Digg Digg
    • Submit to del.icio.us del.icio.us
    • Submit to StumbleUpon StumbleUpon
    • Submit to Google Google

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is Off
    • [VIDEO] code is
    • HTML code is Off

    Forum Rules

    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 2:09 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.