Jump to content

i want replace twiter posts with news section


3245

Recommended Posts

According to the documentation you just have to disable the twitter integration to only show the announcements (General Settings -> Social -> clear "Twitter Username" field).

Alternatively you can remove the following part of the file /templates/<your_template_name>/homepage.tpl to display the announcements:

{if $twitterusername}

    <h2>{$LANG.twitterlatesttweets}</h2>

    <div id="twitterFeedOutput">
        <p class="text-center"><img src="{$BASE_PATH_IMG}/loading.gif" /></p>
    </div>

    <script type="text/javascript" src="templates/{$template}/js/twitter.js"></script>

{elseif $announcements}
....
....
....
And at the end of the file remove the line {/if}. 

Or more simple: Just rename {if $twitterusername} to {if $twitterusername_disabled}

Link to comment
Share on other sites

8 hours ago, string said:

Or more simple: Just rename {if $twitterusername} to {if $twitterusername_disabled}

there's no point editing the template as you'll have to repeat the process after every WHMCS update - if you don't want to show tweets on the homepage, than as @string suggests either remove the Twitter username from settings, or use an action hook to null the $twitterusername variable only on the homepage - the advantage of using the hook being that you wouldn't need to edit the template again after an update - the hook would continue to work.

so you would create a .php file in /includes/hooks/ and call it removetweets.php and paste the code below into it...

<?php

# Remove Tweets from Homepage
# Written by brian!

function remove_tweets_from_homepage_hook($vars) 
{
	return array("twitterusername" => "");
}
add_hook("ClientAreaPageHome", 1, "remove_tweets_from_homepage_hook");
?>

... then the next time you visit the homepage, the tweets will be gone and only the announcements (if they exist) will be shown. thanks.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated