• 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
    • Changes in many pages

    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.

    Results 1 to 9 of 9

    Thread: Changes in many pages

    • Thread Tools
      • Show Printable Version
    1. June 20, 2015 #1
      hollosch
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      hollosch is offline
      Senior Member
      Join Date
      September 19, 2008
      Location
      Geislingen, Germany
      Posts
      241
      Rep Power
      237

      Question Changes in many pages

      Hi,
      i have a [template] in many pages and want do delete this [template] in all pages. Is this possible?
      Reply With Quote Reply With Quote

    2. June 21, 2015 #2
      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
      687
      Since templates are adding in many pages as text, the only safe way to remove them is to edit that text.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    3. June 30, 2015 #3
      hollosch
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      hollosch is offline
      Senior Member
      Join Date
      September 19, 2008
      Location
      Geislingen, Germany
      Posts
      241
      Rep Power
      237
      Is it possible to use a script or "addon" for vaultwiki ?
      Reply With Quote Reply With Quote

    4. July 1, 2015 #4
      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
      687
      Yes, you can certainly write a script that:
      1. Cycles through every page, one at a time.
      2. For each page, run a preg_replace for the pagetext field.
      3. Use the Page DM to apply the pagetext change.
      4. Move on to the next page.

      Code:
      // this code only runs batches of 500 pages, starting at $startat
      
      $pages = vw_DB::get()->query()->select(array(
      	'fields' => array('pageid'),
      	'table' => 'vw_page',
      	'order' => array('pageid' => 'ASC'),
      	'limit' => array($startat, 500)
      ));
      
      $pageids = array();
      
      while ($page = vw_DB::get()->func()->fetch_array($pages))
      {
      	$pageids[$page['pageid']] = $page['pageid'];
      }
      vw_DB::get()->func()->free_result($pages);
      
      vw_Hard_Core::controller('Fetch')->get('Page', $pageids);
      
      foreach ($pageids AS $pageid)
      {
      	$page = vw_Hard_Core::controller('Fetch')->get('Page', $pageid);
      
      	if (empty($page['pagetext'])) // or pagetext does not contain search string
      	{
      		continue;
      	}
      
      	$dm = vw_Hard_Core::controller('DM')->create('Page', 'SILENT');
      	$dm->set_info('is_automated', 1);
      	$dm->set_existing($page);
      
      	// run your replacement code against $page['pagetext']
      
      	$dm->set('pagetext', $new_pagetext);
      	$dm->save();
      	unset($dm);
      }
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    5. July 1, 2015 #5
      hollosch
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      hollosch is offline
      Senior Member
      Join Date
      September 19, 2008
      Location
      Geislingen, Germany
      Posts
      241
      Rep Power
      237
      Oh cool,
      my problem: how can i use this script (where to save, where to start,etc.)
      i'm not a pro in these things... :-(
      Reply With Quote Reply With Quote

    6. July 2, 2015 #6
      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
      687
      Probably the easiest thing is to create an entry in the vault/core/controller/cp/counter folder. Look at the contents of the /url sub-folder for an idea how to implement it.

      Then you would run it by finding it in the Wiki Admin Panel > Integrity > Rebuild Counters / Caches.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    7. July 13, 2015 #7
      hollosch
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      hollosch is offline
      Senior Member
      Join Date
      September 19, 2008
      Location
      Geislingen, Germany
      Posts
      241
      Rep Power
      237
      Hi, there is only a index.html and one vw.php file - no other content for ideas :-(
      Reply With Quote Reply With Quote

    8. August 4, 2015 #8
      hollosch
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      hollosch is offline
      Senior Member
      Join Date
      September 19, 2008
      Location
      Geislingen, Germany
      Posts
      241
      Rep Power
      237
      Could you help me please ?
      Reply With Quote Reply With Quote

    9. August 5, 2015 #9
      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
      687
      Use the content of the vw.php file as a template and create your own controller (named vw.php) in a new directory. The /url/vw.php file is a good example because it already modifies a bunch of pages (but also non-articles, like special pages and synonyms).

      You really just need to modify a cloned version of this file so it performs the replacement you want against the pagetext field. If the pagetext field does not exist, then skip the entry.

      You also want to remove the info lines that say to skip revisions or I think nothing will happen when you change the pagetext.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    Similar Threads

    1. 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
    2. Hide special pages and special pages link for registered users
      By levimatt in forum VaultWiki Questions
      Replies: 1
      Last Post: February 11, 2011, 4:29 AM
    3. Special Pages > Island Pages
      By Mokonzi in forum VaultWiki Questions
      Replies: 3
      Last Post: November 2, 2009, 5:11 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 3:43 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.