| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 15468|Reply: 6
Collapse the left

Get Notices Feature on Mobile View of Discuz!

  [Copy link]
Post time: 2013-11-08 18:17
| Show all posts |Read mode
Edited by Ananthavas at 2013-11-8 19:28

In most cases, it is inconvenient for mobile users, to view notifications on Mobile, since discuz! doesn't have Notices Option on it's mobile version...
Here is a small(simple work around to display Notices Option + Indicator whenever a new Notification comes..
The feature can be obtained by editing header.htm file, which is located at yoursite.com/template/default/mobile/common/


The steps are as follows:
* Edit Header.htm which is located on /template/default/mobile/common/
(Before editing, keep a backup of the original file for safety)

* Look for the following lines which can be found at last..

  1. <div class="hd"><a href="$nav" title="<!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}-->{lang waptitle}"><!--{if $_G['setting']['mobile']['mobilesimpletype'] == 1}--><!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}--> {lang waptitle}<!--{else}--><img src="./static/image/mobile/logo.gif" /><!--{/if}--></a></div>
  2. <div class="wp">
  3.         <div class="pd2">
  4.         <!--{if $_G['uid']}--><a href="home.php?mod=space&uid={$_G['uid']}&do=profile">{$_G['member']['username']}</a><span class="pipe">|</span><a href="home.php?mod=space&do=pm" {if $_G[member][newpm]}class="xi1"{/if}>{if $_G[member][newpm]}{lang new_pm}{else}{lang pm_center}{/if}</a><span class="pipe">|</span><a href="home.php?mod=space&uid={$_G[uid]}&do=favorite&view=me&type=forum">{lang favorite}</a><span class="pipe">|</span><a href="home.php?mod=space&uid={$_G[uid]}&do=thread&view=me">{lang my_posts}</a>
  5. YOU CAN INSERT THE CODES HERE<span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}" title="{lang logout}">{lang logout}</a><!--{elseif $_G['connectguest']}-->{$_G['member']['username']}<span class="pipe">|</span><a href="member.php?mod=logging&action=logout&formhash={FORMHASH}" title="{lang logout}">{lang logout}</a><!--{else}--><a href="member.php?mod=logging&action=login" title="{lang login}">{lang login}</a><!--{if $_G['setting']['regstatus']}--><span class="pipe">|</span><a href="member.php?mod={$_G[setting][regname]}" title="{$_G['setting']['reglinkname']}">{$_G['setting']['reglinkname']}</a><!--{/if}--><!--{if $_G['setting']['connect']['allow'] && !$_G['setting']['bbclosed']}--><span class="pipe">|</span><a href="$_G[connect][login_url]&statfrom=login_simple">{lang qqconnect:connect_mobile_login}</a><!--{/if}--><!--{/if}-->
  6. </div>
  7. <!--{hook/global_header_mobile}-->
Copy the Code
* On the above codes, I had written this: YOU CAN INSERT THE CODES HERE
Just replace it with the following code:
  1. <span class="pipe">|</span><a href="home.php?mod=space&do=notice&mobile=no" id="myprompt"{if $_G[member][newprompt]} class="new"{/if}>{lang remind}<!--{if $_G[member][newprompt]}-->($_G[member][newprompt])<!--{/if}--></a>
Copy the Code
Here, the statement: id="myprompt"{if $_G[member][newprompt]} class="new"{/if}>{lang remind}<!--{if $_G[member][newprompt]}-->($_G[member][newprompt]) is for indicating the new notices count..

* You are almost done!
Just Save the file & open your website in Mobile mode.. It will display Notices option & whenever you get a new notice, it'll display the count indicator too, just like the below picture.




* If you can't edit the files manually, just download the below attachment & replace the header.htm file in yoursite.com/template/default/mobile/common/ with the header file in the zip archive..
This file is already edited & it includes a link to Search option also..

Enjoy!

*Remember to keep a backup of the file, that you're going to edit!

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
Post time: 2013-11-10 06:18
| Show all posts
That is a good one.
Any idea on how to show mobile ads in the mobile version of the site.
 Author| Post time: 2013-11-10 09:11
| Show all posts
Edited by Ananthavas at 2013-11-10 10:57
ravipratap95 2013-11-10 07:18
That is a good one.
Any idea on how to show mobile ads in the mobile version of the site.

Yes it is possible..
If you want to place your ad in global footer, just edit footer.htm in http://yoursite/template/default/mobile/common/
& insert ur ad code in it.

OR
If u want to display ads in threads only, just edit http://yoursite/template/default/mobile/forum/viewthread.htm
& insert ur ad code in it..
A demo:

viewthread.htm: (This is a demo...I had skipped many lines..)
  1. <!--{subtemplate common/header}-->
  2. <!--{if $_G['forum']['type'] != 'sub'}-->
  3.     <div class="box"><a href="forum.php">{$_G['setting']['navs'][2]['navname']}</a> <em> &gt; </em> <a href="forum.php?mod=forumdisplay&fid=$_G[fid]">{eval echo strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];}</a></div>
  4. <!--{else}-->
  5.     <!--{if $_G['forum']['status'] != 3}-->
  6.         <div class="box"><a href="forum.php">{$_G['setting']['navs'][2]['navname']}</a> <em> &gt; </em> <a href="forum.php?mod=forumdisplay&fid={$fup['fid']}">{eval echo strip_tags($_G['cache']['forums'][$fup]['name'])}</a> <em> &gt; </em> <a href="$upnavlink">{eval echo strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];}</a></div>
  7.     <!--{else}-->
  8.         <div class="box"><a href="group.php">$_G['setting']['navs'][3]['navname']</a> $nav[nav]</div>
  9.     <!--{/if}-->
  10. <!--{/if}-->
  11. .
  12. .
  13. .
  14. .

  15. I had skipped many lines due to character limit.
  16. .
  17. .
  18. .
  19. .
  20. .

  21.             <!--{if trim($fastreply) || trim($modeditpost) || trim($modmanage)}-->
  22.                 <div class="box pd2 mbn">
  23.                 $fastreply
  24.                 $modeditpost
  25.                 $modmanage
  26.                 </div>
  27.             <!--{/if}-->
  28.                 <!--// postslist end-->
  29.           </div>
  30.         <!--{hook/viewthread_postbottom_mobile $postcount}-->
  31.         <!--{eval $postcount++;}-->
  32.         <!--{/loop}-->
  33.         $multipage
  34.     </div>
  35. </div>
  36. <!--{hook/viewthread_bottom_mobile}-->

  37. <!--{if $_G['uid'] && $allowpostreply && !$_G['forum_thread']['archiveid'] && ($_G['forum']['status'] != 3 || $_G['isgroupuser'])}-->
  38. <!--{subtemplate forum/forumdisplay_fastpost}-->
  39. <!--{/if}-->

  40. INSERT YOUR AD CODE HERE
  41. <!--{subtemplate common/footer}-->
Copy the Code
On the above file, just replace the sentence "INSERT YOUR AD CODE HERE" with your ad code, so that the ad will be displayed just after the "reply" box as shown below:



If you want to display ads between each posts, follow the instruction by Kaaleth in the following thread:
http://codersclub.org/discuzx/fo ... =3389&fromuid=28539

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
Post time: 2013-11-10 12:53
| Show all posts
Ananthavas 2013-11-10 11:11
Yes it is possible..
If you want to place your ad in global footer, just edit footer.htm in http:// ...

Got it.i will try
Post time: 2014-01-02 13:38
| Show all posts
Ananthavas 2013-11-10 11:11
Yes it is possible..
If you want to place your ad in global footer, just edit footer.htm in http:// ...

it does not workswhen i edit thecode..the hole page stops working .it doesnot opens till i edit the code back to its normal form.


Wha now
 Author| Post time: 2014-01-02 16:34
| Show all posts
ravipratap95 2014-1-2 15:38
it does not workswhen i edit thecode..the hole page stops working .it doesnot opens till i edit th ...

If u are telling about ads, then it should work..
Make sure that u hadn't edited any other important lines..
If everything is ok, let me see the file..

Post time: 2014-01-02 16:52
| Show all posts
Ananthavas 2014-1-2 18:34
If u are telling about ads, then it should work..
Make sure that u hadn't edited any other importa ...

well i resetted the file back to normal...i took a google mobile ad code
i tried it in the place you told me to. the page stopped loading .....only the threads ..rest mobile features worked fine...

also i think in bound links do not affect the code.
where as if we paste any outside code it damages the page..
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-04-26 19:21 GMT+3 , Processed in 0.077576 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list