Ananthavas Publish time 2013-11-08 18:17

Get Notices Feature on Mobile View of Discuz!

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 :lol:) 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..

<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>
<div class="wp">
      <div class="pd2">
      <!--{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}class="xi1"{/if}>{if $_G}{lang new_pm}{else}{lang pm_center}{/if}</a><span class="pipe">|</span><a href="home.php?mod=space&uid={$_G}&do=favorite&view=me&type=forum">{lang favorite}</a><span class="pipe">|</span><a href="home.php?mod=space&uid={$_G}&do=thread&view=me">{lang my_posts}</a>
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}" title="{$_G['setting']['reglinkname']}">{$_G['setting']['reglinkname']}</a><!--{/if}--><!--{if $_G['setting']['connect']['allow'] && !$_G['setting']['bbclosed']}--><span class="pipe">|</span><a href="$_G&statfrom=login_simple">{lang qqconnect:connect_mobile_login}</a><!--{/if}--><!--{/if}-->
</div>
<!--{hook/global_header_mobile}-->
* On the above codes, I had written this: YOU CAN INSERT THE CODES HERE
Just replace it with the following code:<span class="pipe">|</span><a href="home.php?mod=space&do=notice&mobile=no" id="myprompt"{if $_G} class="new"{/if}>{lang remind}<!--{if $_G}-->($_G)<!--{/if}--></a>Here, the statement: id="myprompt"{if $_G} class="new"{/if}>{lang remind}<!--{if $_G}-->($_G) 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!

ravipratap95 Publish time 2013-11-10 06:18

That is a good one.
Any idea on how to show mobile ads in the mobile version of the site.

Ananthavas Publish time 2013-11-10 09:11

Edited by Ananthavas at 2013-11-10 10:57

static/image/common/user_online.gif ravipratap95 static/image/common/clock.gif 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..)<!--{subtemplate common/header}-->
<!--{if $_G['forum']['type'] != 'sub'}-->
    <div class="box"><a href="forum.php">{$_G['setting']['navs']['navname']}</a> <em> &gt; </em> <a href="forum.php?mod=forumdisplay&fid=$_G">{eval echo strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];}</a></div>
<!--{else}-->
    <!--{if $_G['forum']['status'] != 3}-->
      <div class="box"><a href="forum.php">{$_G['setting']['navs']['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>
    <!--{else}-->
      <div class="box"><a href="group.php">$_G['setting']['navs']['navname']</a> $nav</div>
    <!--{/if}-->
<!--{/if}-->
.
.
.
.

I had skipped many lines due to character limit.
.
.
.
.
.

            <!--{if trim($fastreply) || trim($modeditpost) || trim($modmanage)}-->
                <div class="box pd2 mbn">
                $fastreply
                $modeditpost
                $modmanage
                </div>
            <!--{/if}-->
                <!--// postslist end-->
          </div>
      <!--{hook/viewthread_postbottom_mobile $postcount}-->
      <!--{eval $postcount++;}-->
      <!--{/loop}-->
      $multipage
    </div>
</div>
<!--{hook/viewthread_bottom_mobile}-->

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

INSERT YOUR AD CODE HERE
<!--{subtemplate common/footer}-->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

ravipratap95 Publish time 2013-11-10 12:53

static/image/common/user_online.gif Ananthavas static/image/common/clock.gif 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

ravipratap95 Publish time 2014-01-02 13:38

static/image/common/user_online.gif Ananthavas static/image/common/clock.gif 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

Ananthavas Publish time 2014-01-02 16:34

static/image/common/user_online.gif ravipratap95 static/image/common/clock.gif 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..

ravipratap95 Publish time 2014-01-02 16:52

static/image/common/user_online.gif Ananthavas static/image/common/clock.gif 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..
Pages: [1]
View full version: Get Notices Feature on Mobile View of Discuz!