plugins/admin/PageGroups.php
changeset 183 91127e62f38f
parent 156 edbff85d43e8
child 187 9dbbec5e6096
child 195 eec079676fe7
equal deleted inserted replaced
176:1bc7e849a264 183:91127e62f38f
   598                 $q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';');
   598                 $q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';');
   599                 if ( !$q )
   599                 if ( !$q )
   600                   $db->_die();
   600                   $db->_die();
   601                 else
   601                 else
   602                   echo '<div class="info-box">The affecting tag was updated.</div>';
   602                   echo '<div class="info-box">The affecting tag was updated.</div>';
       
   603               }
       
   604             }
       
   605             else if ( $_POST['pg_type'] == PAGE_GRP_REGEX )
       
   606             {
       
   607               $target = $_POST['pg_target'];
       
   608               if ( empty($target) )
       
   609               {
       
   610                 echo '<div class="error-box">Please enter an expression to match against..</div>';
       
   611               }
       
   612               else
       
   613               {
       
   614                 $target = $db->escape($target);
       
   615                 $q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';');
       
   616                 if ( !$q )
       
   617                   $db->_die();
       
   618                 else
       
   619                   echo '<div class="info-box">The expression to match against was updated.</div>';
   603               }
   620               }
   604             }
   621             }
   605             else if ( $_POST['pg_type'] == PAGE_GRP_CATLINK )
   622             else if ( $_POST['pg_type'] == PAGE_GRP_CATLINK )
   606             {
   623             {
   607               $target = $_POST['pg_target'];
   624               $target = $_POST['pg_target'];
   858                   <td class="row1">
   875                   <td class="row1">
   859                     <input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" />
   876                     <input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" />
   860                   </td>
   877                   </td>
   861                 </tr>';
   878                 </tr>';
   862           break;
   879           break;
       
   880         case PAGE_GRP_REGEX:
       
   881           echo '<tr>
       
   882                   <td class="row2">
       
   883                     Regular expression to use:<br />
       
   884                     <small>Be sure to include the starting and ending delimiters and any flags you might need.<br />
       
   885                            These pages might help: <a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">Pattern modifiers</a> &bull;
       
   886                            <a href="http://us.php.net/manual/en/reference.pcre.pattern.syntax.php">Pattern syntax</a><br />
       
   887                            Examples: <tt>/^(Special|Admin):/i</tt> &bull; <tt>/^Image:([0-9]+)$/</tt><br />
       
   888                            Developers, remember that this will be matched against the full page identifier string. This means that <tt>/^About_Enano$/</tt>
       
   889                            will NOT match the page Special:About_Enano.</small>
       
   890                   </td>
       
   891                   <td class="row1">
       
   892                     <input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" />
       
   893                   </td>
       
   894                 </tr>';
       
   895           break;
   863         case PAGE_GRP_CATLINK:
   896         case PAGE_GRP_CATLINK:
   864           
   897           
   865           // Build category list
   898           // Build category list
   866           $q = $db->sql_query('SELECT name,urlname FROM '.table_prefix.'pages WHERE namespace=\'Category\';');
   899           $q = $db->sql_query('SELECT name,urlname FROM '.table_prefix.'pages WHERE namespace=\'Category\';');
   867           if ( !$q )
   900           if ( !$q )