• Board index ‹ Special Interest Forum ‹ phpBB3 Mods
  • Change font size
  • FAQ • Search • Register • Login

It is currently Thu Mar 11, 2010 9:13 pm

Simple phpBB3 Smiley Pagination Mod V1

Place to discuss phpbb3 modifications. Help, tips, ideas, suggestions...with no guarantees!!!!
Post a reply
67 posts • Page 3 of 3 • 1, 2, 3

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby maxxphlipper on Tue Dec 30, 2008 4:29 pm

No Worries thanks Vlad I hope that I can find something useful.
maxxphlipper
 
Posts: 3
Joined: Sun Dec 28, 2008 8:46 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Thu Jan 08, 2009 7:20 pm

maxxphlipper wrote:Hi Ladybug,
When you put the mod on your main forum is it still version 3.0.3 or is it 3.0.2, I am having the same problem with the link opening another copy of the posting page and not the smilies page. I am using version 3.0.4, I have tryed different browsers, different computers. Changed between prosilver and subsilver2 styles and deleted my cache though the ACP and manually. If I manually input the link for the extra smilies as described earlier in the topic that works fine.

So I was just wondering what other changes or updates you had made to get the mod to work correctly.

The only thing that I notice is when I go to the link on Vlads forum the link to the extra icons is this:
posting.php?mode=smilies&f=16
and on my test forum it is this:
http://www.scholzfamily.com/forum1/post ... &f=10&t=13

There seems to be some extra coding at the end, not sure if it means anything, maybe someone can shed some light on the problem.

Phil


So sorry I didn't see this sooner but to answer your question, this was installed in 3.0.3 and we have since updated to 3.0.4 with no issues. The first page still shows fewer smilies than the other pages but I have no complaints about that and none of the forum members has even mentioned it.

I have been wondering if there is a way to have the pop outs start on what is currently page two of the smilies. If not, that's okay too.

Have you had success, maxx?
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby jan suhr on Thu Feb 12, 2009 8:16 am

I have the same problem as Sky,
I don't get any text "View more smilies" at all, not on ProSilver or in the template I use. The template I use has the smiliepart in the posting_body.html file. There is a psoting_smilie.html file but that doesn't seem to be used, not at least when writing a new post.

I put a border to the table to see were everything goes and I get an extra row but no "View more smilies" in that row. If I add some text in to the row its there.

I get a new window of smilies if I go with the suggestion of yourdomian.com/posting.php?mode=smilies&start=0

If I force the showing of "View more smilies" it willopen a new window with the editor just as Sky gets.

So is there any progress on the problems we have.

Here is the code for my file posting_body.html
Code: Select all
<table width="100%" cellspacing="5" cellpadding="0" border="1" align="center">
      <tr>
         <td class="gensmall" align="center"><b>{L_SMILIES}</b></td>
      </tr>
      
      <tr>
         <td align="center">
            <!-- BEGIN smiley -->
               <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a>
            <!-- END smiley -->
         </td>
      </tr>
      <tr>
            <td align="center"><span class="genmed">{PAGINATION}Nisse is here</span></td>
         </tr>
         
      <!-- IF S_SHOW_SMILEY_LINK -->
         <tr>
            <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a></td>
         </tr>
      <!-- ENDIF -->

      </table>


Thanks

Jan Suhr
Stockholm, Sweden
jan suhr
 
Posts: 2
Joined: Thu Feb 12, 2009 7:27 am
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby jan suhr on Thu Feb 12, 2009 4:06 pm

I now have the "View More Smilies# row showing, it was just that I had all smilies set to show on Posting page.

I think it works now.


JAn
jan suhr
 
Posts: 2
Joined: Thu Feb 12, 2009 7:27 am
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby Vladd44 on Fri Feb 13, 2009 7:37 am

Hello JAn,

What setting did you change and where?

I have helped people sort this out the hard way, but never a way I liked.

I knew it had to be a setting since it showed in some and not in others. :jesus4
Jewish Kid: Is anyone else having problems concentrating on this? I just can't seem to concentrate.
Cartman: Maybe we should send you to a concentration camp.
User avatar
Vladd44
Site Admin
 
Posts: 4573
Joined: Wed Dec 31, 1969 7:00 pm
Location: New Orleans Crypt 69
  • Website
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby FLATTOP on Wed Mar 18, 2009 8:41 pm

ok, I finally got this working, I installed the mod, changed it to display 10 smilies but was not seeing the link to "view more smilies". The above post that jan made about setting the smilies to display on posting page was the answer, that was my issue as well, I had all mine set to display on posting page, here is the fix:

go to your admin panel, click on posting, then click on smilies on the left hand side. that will bring up your entire list of smilies, on the right side you will see options such as move up, move down, delete, edit. click on edit, that will bring up a new page for that individual smiley, you will see a check box for display on posting page, UNCHECK that box! that's how you get the view more smilies link to appear. click submit, then on to the next one. I don't know of a way to uncheck a mass of them in one click so I did a handful one by one.

After doing that, the view more smilies link appeared, the pop up box worked like a charm and the page numbers worked as well, thanks Vladd for such an easy mod.
FLATTOP
 
Posts: 3
Joined: Wed Mar 18, 2009 8:27 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby Vladd44 on Thu Mar 19, 2009 11:59 am

FLATTOP wrote:go to your admin panel, click on posting, then click on smilies on the left hand side. that will bring up your entire list of smilies, on the right side you will see options such as move up, move down, delete, edit. click on edit, that will bring up a new page for that individual smiley, you will see a check box for display on posting page, UNCHECK that box! that's how you get the view more smilies link to appear. click submit, then on to the next one. I don't know of a way to uncheck a mass of them in one click so I did a handful one by one.


I will add this to the original page, along with credit to you FLATTOP for bringing this to my attention as the easy (and correct) way to get that damn "View More Smilies" link.

As to how to "uncheck" them rather easily. If you have phpmyadmin access (I will also offer a simple script to do so for anyone if they need it).

Just go to phpmyadmin (Usually from your hosting account Plesk/Cpanel/WHM etc)

Choose your Database, and select Sql from the top menu.

In the form box enter the following

UPDATE phpbb_smilies SET display_on_posting=0 WHERE smiley_id>15

If you want more than 15 (or less) then change the 15 to whatever you wish to have set to display on the main page.
Jewish Kid: Is anyone else having problems concentrating on this? I just can't seem to concentrate.
Cartman: Maybe we should send you to a concentration camp.
User avatar
Vladd44
Site Admin
 
Posts: 4573
Joined: Wed Dec 31, 1969 7:00 pm
Location: New Orleans Crypt 69
  • Website
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby FLATTOP on Thu Mar 19, 2009 1:18 pm

Thanks Vladd!
that's a nice little DB query script, much easier than doing it manually.
FLATTOP
 
Posts: 3
Joined: Wed Mar 18, 2009 8:27 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby FLATTOP on Thu Mar 19, 2009 1:25 pm

Quick question,
for this part of the code
Code: Select all
// For pagination.
$smiley_limit = 100;
does the number have to be the same as the number in the DB query your run? would there be a conflict/error if the numbers are different?
FLATTOP
 
Posts: 3
Joined: Wed Mar 18, 2009 8:27 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby Vladd44 on Thu Mar 19, 2009 1:59 pm

FLATTOP wrote:Quick question,
for this part of the code
Code: Select all
// For pagination.
$smiley_limit = 100;
does the number have to be the same as the number in the DB query your run? would there be a conflict/error if the numbers are different?



No, the limit in my mod code is about the limit of smilies per page on the page the view more smilies brings up.

The "UPDATE phpbb_smilies SET display_on_posting=0 WHERE smiley_id>15 " is simply to tell mysql at what point to quit posting the smilies up the main posting page.

No Worries on a conflict or problem.

Also if you wanted to restore or do the opposite (for example enable all below 44 :D to show on posting page, a simple update such as below would do the trick.

UPDATE phpbb_smilies SET display_on_posting=1 WHERE smiley_id<44

(This would set all smileys with an id of less than 44 (1-43) to be listed as to be displayed on the main posting page.
Jewish Kid: Is anyone else having problems concentrating on this? I just can't seem to concentrate.
Cartman: Maybe we should send you to a concentration camp.
User avatar
Vladd44
Site Admin
 
Posts: 4573
Joined: Wed Dec 31, 1969 7:00 pm
Location: New Orleans Crypt 69
  • Website
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Sat Nov 28, 2009 7:22 am

Vladd, just wondering if you have updated to 3.0.6 and found any problems with the Pagination Mod? We have and can't seem to sort it out.

It'll probably be a week before I can really get into specifics with you as I am on the road visiting out of state family and friends and haven't had time to really check things out further. I thought I'd at least check and see if you have run into any issues. If so, have you worked them out yet?
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Fri Dec 04, 2009 6:09 pm

Hi again! I am back home now and will really appreciate your input. Your skills are needed and appreciated.

After the 3.0.6 update...we get an error message on the smiley pop out page:
/includes/functions_posting.php on line 152: Division by zero

Note
Line 152 appears towards the end of the code shown below and reads:
$total_pages =ceil($n_smiles/$smiley_limit);
It is about the 12th line from the bottom.


On my test forum, I have it so that only the smilies I want to show on the posting page do show however, 40 of the 47 smilies show on the one smilie pop out page. I don't know why 7 of them are not showing. However, I want to control the number of the smilies that appear on each page of the pagination. Some of our members are on dial up and it doesn't help to have too many load on a page.
Edit: I found the General/Board Configuration/Post Settings section and was able to limit the number of smilies that appear.

The bottom text (Now Showing Page 1 of 0. Total Pages) appears two times. There is no number mentioned either before or after "Total Pages". Edit...this is big problem. Only the initial pop out is available, no additional pages. I used to have 5 total pages.

This is happening on both our ProSilver theme and the SubSilver2 based theme, Blue Moon.

Could you give me a clue as to how to correct this (the error that appears on the smilie pop out and how to get additional pages back)? Right now we have the smilies turned off on the main forum and they are sorely missed.

Edit: Below appears the portion that applies to the Smilies of the includes/functions_posting.php file
Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: functions_posting.php 10008 2009-08-17 14:45:14Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

/**
* Fill smiley templates (or just the variables) with smilies, either in a window or inline
*/
function generate_smilies($mode, $forum_id)
{
   global $auth, $db, $user, $config, $template;
   global $phpEx, $phpbb_root_path;

   $start = request_var('start', 0);

   if ($mode == 'window')
   {
      if ($forum_id)
      {
         $sql = 'SELECT forum_style
            FROM ' . FORUMS_TABLE . "
            WHERE forum_id = $forum_id";
         $result = $db->sql_query_limit($sql, 1);
         $row = $db->sql_fetchrow($result);
         $db->sql_freeresult($result);

         $user->setup('posting', (int) $row['forum_style']);
      }
      else
      {
         $user->setup('posting');
      }

      page_header($user->lang['SMILIES']);

      $sql = 'SELECT COUNT(smiley_id) AS count
         FROM ' . SMILIES_TABLE . '
         GROUP BY smiley_url';
      $result = $db->sql_query($sql, 3600);

      $smiley_count = 0;
      while ($row = $db->sql_fetchrow($result))
      {
         ++$smiley_count;
      }
      $db->sql_freeresult($result);

      $template->set_filenames(array(
         'body' => 'posting_smilies.html')
      );

      $template->assign_var('PAGINATION',
         generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id),
            $smiley_count, $config['smilies_per_page'], $start, true)
      );
   }

   $display_link = false;
   if ($mode == 'inline')
   {
      $sql = 'SELECT smiley_id
         FROM ' . SMILIES_TABLE . '
         WHERE display_on_posting = 0';
      $result = $db->sql_query_limit($sql, 1, 0, 3600);

      if ($row = $db->sql_fetchrow($result))
      {
         $display_link = true;
      }
      $db->sql_freeresult($result);
   }

   if ($mode == 'window')
   {
      $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
         FROM ' . SMILIES_TABLE . '
         GROUP BY smiley_url, smiley_width, smiley_height
         ORDER BY smiley_order';
      $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
   }
   else
   {
   // For pagination.
   $smiley_limit = 30;
   if (isset($_GET['start'])) {
   $start =  intval($_GET['start']);
   } else {
   $start =0;
   }
   $sql = 'SELECT *
         FROM ' . SMILIES_TABLE . '
         WHERE display_on_posting = 1
      ORDER BY smiley_order';
   $result = $db->sql_query($sql, 3600);
   }

   $smilies = array();
   while ($row = $db->sql_fetchrow($result))
   {
      if (empty($smilies[$row['smiley_url']]))
      {
         $smilies[$row['smiley_url']] = $row;
      }
   }
   $db->sql_freeresult($result);

   if (sizeof($smilies))
   {
      $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;

      foreach ($smilies as $row)
      {
         $template->assign_block_vars('smiley', array(
            'SMILEY_CODE'   => $row['code'],
            'A_SMILEY_CODE'   => addslashes($row['code']),
            'SMILEY_IMG'   => $root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
            'SMILEY_WIDTH'   => $row['smiley_width'],
            'SMILEY_HEIGHT'   => $row['smiley_height'],
            'SMILEY_DESC'   => $row['emotion'])
         );
      }
   }

      $template->assign_vars(array(
         'S_SHOW_SMILEY_LINK'    => true,
         'U_MORE_SMILIES'       => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id))
      );
   if ($mode == 'window')
   {
// additions to pagination
if ($start){
$cp = $start / $smiley_limit+1;
} else {
$cp = 1;
}
$pagination = '';
$ref = $db->sql_query('SELECT * FROM '. SMILIES_TABLE );
$n_smiles = $db->sql_affectedrows('SELECT * FROM '. SMILIES_TABLE );
$total_pages =ceil($n_smiles/$smiley_limit);
for ($apl=1; $apl<=$total_pages; $apl++) {
$pagination.= '<a href="'.$phpbb_root_path.'posting.php?mode=smilies&start='.(($apl-1)*$smiley_limit).'"> '.$apl.' </a>';
}
$pagination = "<br><center>Now Showing Page $cp of $total_pages. <br>Total Pages $pagination </center>";
$template->assign_vars(array(
'PAGINATION' => $pagination ));
// end additon to pagination
      page_footer();
   }
}

This section of code in the 3.0.6 version has more lines of code than the previous versions. The entire file is much bigger than the previous versions.
Last edited by ladybug on Sun Dec 06, 2009 4:32 pm, edited 1 time in total.
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby Vladd44 on Sat Dec 05, 2009 3:51 pm

I am occupied until sunday night, will take a look bright and early monday morning.
Jewish Kid: Is anyone else having problems concentrating on this? I just can't seem to concentrate.
Cartman: Maybe we should send you to a concentration camp.
User avatar
Vladd44
Site Admin
 
Posts: 4573
Joined: Wed Dec 31, 1969 7:00 pm
Location: New Orleans Crypt 69
  • Website
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Sat Dec 05, 2009 5:25 pm

Great! Thanks for the heads up, Vladd. See ya then!
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Tue Dec 08, 2009 11:01 am

Here is my prosilver template/posting_smilies.html file:
Code: Select all
<!-- INCLUDE simple_header.html -->

<script type="text/javascript">
// <![CDATA[
   var form_name = 'postform';
   var text_name = 'message';
// ]]>
</script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>

<h2>{L_SMILIES}</h2>
<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>
      <span class="genmed">{PAGINATION}</span>
      <!-- BEGIN smiley -->
         <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
      <!-- END smiley   -->
   
   <div class="inner"><span class="corners-bottom"><span></span></span></div>
                <span class="genmed">{PAGINATION}</span>
</div>
<div>{PAGINATION}</div>
<a  href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>

<!-- INCLUDE simple_footer.html -->
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Mon Dec 14, 2009 3:11 pm

Hi, Vladd! Just checking in to see if you've had the chance to look over my dilemma and, if so, what your thoughts are.

I've still got my fingers crossed.
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Re: Simple phpBB3 Smiley Pagination Mod V1

Postby ladybug on Sat Dec 19, 2009 12:24 am

I cleaned up the files and everything is back to normal. The built in smilie pagination is working for me in 3.0.6. Now that phpBB3 has the pagination up and running, a mod isn't necessary but your Mod was great and I was glad to have it.
ladybug
 
Posts: 13
Joined: Wed Aug 27, 2008 11:50 pm
Top

Previous

Post a reply
67 posts • Page 3 of 3 • 1, 2, 3


Return to phpBB3 Mods

Who is online

Users browsing this forum: No registered users and 0 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC - 6 hours [ DST ]
  • SitemapIndex SitemapIndex
  • RSS Feed RSS Feed
  • Channel list Channel list
© 2000, 2002, 2005, 2007 phpBB Group •
phpBB SEO
created by stylerbb.net & nero