|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
" a9 a1 z8 e9 y. F% U0 a M// Theme Option+ b6 ?" @* ]8 K/ U, S
////////////////////////////////////////////////////////////////////////////////# |7 J, o" k/ d7 z2 ]
% L. X1 T+ @2 [% V# P$themename = "Zenx";
" z# r" S5 r8 Y) r* n$shortname = str_replace(' ', '_', strtolower($themename));7 @7 \; I& h: a) j( R+ B/ q
4 c- [% k: e6 P6 Dfunction get_theme_option($option)3 s2 @& |: S4 }! w
{
4 q0 N1 _: n$ f4 S global $shortname;
' a, D7 E+ j6 {! ] return stripslashes(get_option($shortname . '_' . $option));2 p. g" N; ?4 H3 S3 P
}
. `% n- g. Y7 E: u6 G6 q: h8 g8 ]. s7 X4 \* r) N
function get_theme_settings($option)
8 F; l$ m$ m# U* N{' s% \* B* D& g6 p& Q# g
return stripslashes(get_option($option));
8 p2 i, e2 J* [7 E/ S, v# t}
- f( w' I( c' r* {: |$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
6 y$ g# y2 W4 W6 |5 R9 [2 B0 j$wp_getcat = array();
7 M' a T1 O& ^' [foreach ($wp_dropdown_rd_admin as $category_list) {; w1 R, V1 z$ O9 X% a! t) _/ p
$wp_getcat[$category_list->term_id] = $category_list->name;
7 U% m# y* ^2 l, r7 b}
3 k+ a; ~" B/ I, {8 E" y- O$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
6 r2 O3 G% U0 X$ o4 I$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
/ M& n9 l+ z- C7 ?! y. Q, y# L% b3 H$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");2 d1 z6 T4 y/ R0 @7 c* a0 r
' u4 g& e& e( s$options = array (% G& K: Q' @: p3 w- o( M
3 W% Q% c2 s; m8 M9 s4 R" N/ e7 ~
; x& ^6 W4 u& w) T9 n h array( "name" => "Blog Header Settings",
- Q% R: t$ a1 d4 [& I5 p "type" => "heading",! z( v- |+ R& ]% s1 w
),
& ?5 Y* T9 t i7 u, g9 `5 Q, ]3 T+ |8 O# D
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! Q8 o- B# `! Q6 A( {
"id" => $shortname."_header_logo_activate",
/ p5 `' `0 P( ?' c "type" => "select",
9 h% A+ [% b2 \& ^ G "std" => "No",! V' X# Z7 p) m$ W3 F
"options" => array("No", "Yes")),# p( E% a: B/ Q. r- j- }- ~
) P3 K0 Y, y: S; ?
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
3 i9 O' k5 E! I4 P' j Q "id" => $shortname."_logo_url",
w, |# ?# E- U+ X- i "type" => "text",
2 ^+ ^1 L8 _- o; z6 J e "box" => "social",
8 g# n0 I" A9 F( c2 g: N, E "std" => "",
4 d2 w. ]$ Q3 T' ]1 \" Q ),$ @% `' K8 s! L( U
4 ~9 [. z1 s. a6 W array( "name" => "Insert Header Banner HTML Code (Header)
O& x( F: u9 [% ^' P1 \4 X% Q; {( s <br /><em>*Recommended Size 468 x 60</em>
/ C# y& [" D8 H+ } <br /><em>*leave blank if not use</em>",) |2 Z3 J2 J/ K2 D
"id" => $shortname."_header_banner",
! a2 d7 B2 Y9 i "type" => "textarea",
6 s y/ i$ z2 U! X "std" => "",) E% N/ X" E- T
),) E. ^& n* U* ?8 l
1 d/ V$ V, G9 { array( "name" => "</div></div>",
7 v- m: ?7 p+ c4 f+ u( [' H8 E "type" => "close",
2 I+ k, o0 `0 P5 k9 a* y ),8 M! d, j* T3 Y% [% n( I1 ?
( O, w( t+ E$ u4 ]3 C. q) {2 Z
3 z" H% ?# ~7 Z0 f& Z array( "name" => "Header Navigation Settings",
( q1 y5 S8 F# H3 [* |' P7 F "type" => "heading",& ]) @7 Q. \) @7 _: A/ z! U7 P
),: ^; u- J/ J5 F3 @' U+ H; M* K
! e' s# a! q' b: _# Y$ V- Y$ m; d array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
) R8 p* ]. m6 {: @ <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
) m' ~! e/ m& l o! [7 m- G4 m# D <em>*Enter the page post ID number only</em><br />' c! L0 l$ |* h; o
<em>*separate by comma</em><br />" L5 t) `; l9 U( m# I. @- L
<em>*Exclude pages which you don't want to show on the header navigation</em>",
7 f9 w# _( y9 N( H* ~6 W3 t "id" => $shortname."_header_page_navigation",6 u4 x1 o3 M9 k4 A' W/ r
"type" => "text",
8 ^' ^; o' j; Z3 Y "std" => "",1 Y' ^- n2 q3 ?" y7 ^ O
),
" y2 S o+ E3 p! \0 n3 m% G& c: y( Q( [4 {( T
array( "name" => "</div></div>",
9 K3 N% D$ | e8 Z+ z "type" => "close",1 F, x/ M' j$ \! A' Q
),4 s. X& ]0 V9 M
0 o; {9 @9 Z2 x: @0 c0 Q4 e4 g& \1 s+ g# L8 J- Z
array( "name" => "Post Auto Thumbnails Settings",# M9 \* q' A/ S1 C5 g& F1 }
"type" => "heading",1 I( J$ D. T5 Z* }2 |8 j5 }
),7 b: B; M3 ]7 T) J1 U" y5 n
' W9 \, D+ |- y% Y
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! h, R' L, \2 G' t1 i% y1 i ^ "id" => $shortname."_timthumb_activate",
# u" y8 V( `. N9 q "type" => "select",
/ k0 M4 E3 f. T" t) a+ d! T "std" => "No",. J/ c" ?9 m; l1 Z: r) Z6 r
"options" => array("No", "Yes")),4 ?6 W7 i0 a; U7 g
, M' x8 h' c7 s+ C+ G8 W
array( "name" => "If Timthumb is enabled, Please choose its cropping method",- r( ~; S! M7 D; b. {8 n$ b
"id" => $shortname."_timthumb_cropping",' L/ `: L7 x; _3 B
"type" => "select",
7 G9 V; ]0 Q6 `7 Q" f "std" => "",, h5 @9 o3 s* B+ d4 Z+ m% x. u4 s
"options" => $crop_position),6 k3 N# |. ~7 v- [
; z: x! B# a0 j$ R% i
array( "name" => "Insert Width Of Thumbnail Image<br />0 E1 A/ v+ b9 \( I
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& E7 R) y. E3 W; n, W& x
<em>*Leave Blank To Use Default: 250</em><br />",
1 T( C6 u, [, z* ^, O3 {7 ^* c "id" => $shortname."_thumb_width",
; l0 j8 Q2 d: Y "type" => "text",
8 i) F# t3 v& K( Z2 k; I9 b5 t "std" => "",
. u" C3 {6 r% o/ H/ P* P+ o! R ),
5 i7 r& _; W8 n' N0 U# a6 n9 R8 k) ?+ f# M: t' u( x0 W4 S
array( "name" => "Insert Height Of Thumbnail Image<br />& E4 O- `9 d6 z4 a) p/ k
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /> b1 G: e& J; X/ ]7 P
<em>*Leave Blank To Use Default: 200</em><br />",3 b# K2 x8 S/ q% u& U8 Z
"id" => $shortname."_thumb_height",
3 I0 Y- u7 {, I9 T "type" => "text",
0 K4 Z. Y7 [/ ` "std" => "",, n5 e. v M1 @$ N* D
),
& }1 b. |6 X, M$ J# H7 S
" `4 |% O- p1 V8 D" u array( "name" => "</div></div>",$ ^1 ], X& }* P9 y7 n
"type" => "close",' B+ N( g0 U: a" H8 d) A$ h
),
% U/ B6 t+ `) W, @* {# }1 s7 j- u& B
array( "name" => "Featured Content Slider Settings",
, M8 _5 Z" G/ V0 x3 z0 V "type" => "heading",9 H2 @7 Q3 A4 e( H( e
),
2 x0 F7 u; H' A# Y: n7 ~
0 Z% D; I: o3 l& D$ K8 P2 \1 g array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 c# h. z/ |- S$ g# V "id" => $shortname."_featured_activate",
% j; K6 \/ b/ u8 i Z "type" => "select",
+ E, v" B$ B5 v0 m m "std" => "No",
2 c# k1 z( \( C1 \ M "options" => array("No", "Yes")),! Y5 v4 P" E( H' l
, ?: k0 O0 u4 M/ S+ \, u/ |
0 `: ]" D, U& ]5 y% e% m array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
+ K8 ^2 b3 @$ _1 Q' N* j+ s "id" => $shortname."_featured_category",
6 p; J# M+ N0 d! o V% T5 I "type" => "select",
: I& q4 m+ Z% I7 J& y0 b "std" => "Choose a category:",5 q& y8 a1 \; w" ^( W/ Y9 @
"options" => $wp_getcat),
- J' N/ D! K: P7 j7 P: D6 L
$ O! E, ?) u0 x' c# Z array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",8 v _! `/ s% v I
"id" => $shortname."_featured_number",4 _/ w9 O! u, ?( u* g/ Z, C
"type" => "select",$ V0 Q6 g9 q- X y
"std" => "Number of post:",
Q- S. `. c$ b6 E1 A "options" => $number_entries),
! O5 w) M6 D3 o" u& V0 K( k4 T0 \+ f; U
array( "name" => "</div></div>",$ y; O# _0 I0 o' C9 C, t( T2 J8 r7 D
"type" => "close",1 `+ f8 q+ H1 |* Z
),
* N' D: ]& z+ Z) B3 C1 s/ e , E3 \ p; j4 ?7 V! b4 P. [" {: p! ~
array( "name" => "Featured Category Settings",
( v# s7 p3 Y) E- [1 f2 W' W; t9 A "type" => "heading",8 T$ B( K8 V1 B8 R8 U/ |
),
$ \4 k5 o- m; i1 c8 r$ J0 p8 \) q% A+ B3 s/ t5 o6 c
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 {9 j8 q! `/ p. @: s' u/ H/ ^
"id" => $shortname."_featured_category_activate",* @# I5 O6 G4 v. U/ L! t
"type" => "select",( D/ B- H1 ]4 k8 R
"std" => "No",
: l, W+ X# p8 d# K. L "options" => array("No", "Yes")),7 w. ~' v2 `4 U3 M. T( K; Y3 P
2 {0 a3 C5 u" C# T3 R4 U x! W+ z
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
" s& J8 _3 }; b6 n "id" => $shortname."_featured_category_id1",9 ?" o+ M: E1 c7 n
"type" => "select",2 e6 G- C$ D$ T$ p
"std" => "Choose a category:",$ P% W# W R+ y& h( `
"options" => $wp_getcat),
( M7 }0 F8 a0 u# x D 9 ~0 r$ N# C4 M3 |" `: y
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",) v/ ~$ H+ h s. }6 `5 v
"id" => $shortname."_featured_number1",
3 i& t0 i5 ]+ u8 Z9 R) ?$ G3 D "type" => "select",+ J% s, X7 _1 }) m4 y+ {4 P0 S: |' r
"std" => "Number of post:",3 R2 p1 e0 o- e2 C( F: \9 f
"options" => $number_entries),
1 S+ S& ~8 a# I% L5 p
6 W X3 g+ Q/ A' j6 E& G array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",2 T+ p! \* ?! g! S; {! a# [2 l6 C8 p
"id" => $shortname."_featured_category_id2", ]3 f, N5 ~9 y0 `. {
"type" => "select",- n# f" c) {4 H& ]" I
"std" => "Choose a category:",* j3 E5 p6 r6 x' a/ D& A
"options" => $wp_getcat),
' T( ?5 |+ O" `% G
) R r- c7 Q2 J/ O: F ]; I v array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",) }& C0 o: x. t/ j. |1 p
"id" => $shortname."_featured_number2",- F7 L! n: e2 n& M% v
"type" => "select",' n) w; I7 n. o, w; ]
"std" => "Number of post:",4 X( j" C+ n! Q2 L% I
"options" => $number_entries),
$ {- `. u% M8 q, I+ k 5 K) B8 r* p9 l+ ^+ B# @
" |5 v3 r& C* v9 s
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
. p; I, {1 I! ? "id" => $shortname."_featured_category_id3",: M. K+ e9 C% R E% q! e8 G
"type" => "select",; X, t( |& \) m5 [; F
"std" => "Choose a category:",
6 S1 U! H/ N. D# N "options" => $wp_getcat),6 T! V# a/ d' E7 i( Q8 Y, i5 z
1 g# |, I/ P- F8 L* D! t- O0 l8 U
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>", g2 b. H4 ^$ z& R/ E I
"id" => $shortname."_featured_number3",
- {2 M& E! i7 d1 S4 I% K "type" => "select",; d* Q( y+ q3 ~! e1 n$ l& z/ b
"std" => "Number of post:",
- g6 R: A' s7 U "options" => $number_entries),
+ _; c+ i; q+ u/ l9 H8 a
0 m7 i* n' { ~7 k: X8 q0 [! c# c' z% z5 D5 Q, U" Y: Z- ]8 U
array( "name" => "</div></div>",
, Y; M5 e% F& c "type" => "close",
" {( |( j8 \ G: t ),
- u: [/ t# H( V/ o( L, m! {2 M/ w. ]5 C; P
9 L# o+ c5 H% r# ?/ @, ^
array( "name" => "Google Adsense & Analytics Settings",
& }& `; i" X7 [: O+ ^: z2 Y8 o$ n "type" => "heading",
/ {9 l9 F4 V1 O6 ?$ f ),4 k" n6 [7 i/ P6 l3 `) Y X
& R) F+ ?. v* m/ h, t, H$ a
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
" a" w4 d5 |; L) d2 R "id" => $shortname."_adsense_loop_activate",
( P" B8 t, I1 n! @ "type" => "select",
) w7 J) o% ~+ l+ \8 e6 q! i "std" => "Disable",
' F+ u- J1 ^% m "options" => array("Disable", "Enable")),
* X9 V$ D* S' o% f" z$ K9 p5 I- ]& J
array( "name" => "Insert Google Adsense Code For Loops Here<br />
( J0 U. c4 J! K4 r1 J0 n3 x <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; R6 _* r$ l0 l C5 w
"id" => $shortname."_adsense_loop",0 Q3 }# A" Z$ I7 l* `& p p
"type" => "textarea",, C. B8 j% \: E3 g# ~5 Y5 _
"std" => "",
$ k* x1 b2 y" N, i! g ),
9 X8 d% X( @, R; o' [+ J+ u3 c' q# o& U2 P8 o0 f& U
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
# Q: U2 ] s: r$ `8 I "id" => $shortname."_adsense_single_activate",' C. O5 J/ ^0 Y9 Z# I) M" r& c! \* M9 m
"type" => "select",0 z% ?# b3 l- J
"std" => "Disable",
: }0 {- Q% V' e: L8 G8 G* ] "options" => array("Disable", "Enable"))," o' I r7 Y/ w+ D. Y: F
( k1 U* v2 B x7 t( N; a array( "name" => "Insert Google Adsense Code For Single Page Here<br />
+ C2 W9 e2 M5 s8 K1 n <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
3 l" O* |+ u7 ?, K5 Z "id" => $shortname."_adsense_single",
8 W& p: ^) _( N% A: u/ d3 h) _ "type" => "textarea",- q$ i7 z. s# O7 [
"std" => "", a7 @' r" Q, T: T9 [0 v
),$ J8 J0 V" `8 v9 j) A
0 E) D; V7 h, g) b# C/ u
4 C. b+ B7 Q G' Q8 j array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
4 a, }3 s: q( v/ d! p4 X "id" => $shortname."_google_analytics",
2 Z8 @2 l( r% a# g; v "type" => "textarea",
( G, i, ~3 z5 B1 z3 e, | "std" => "",
0 e9 x3 n( n8 @$ O ),, d" ~* H V/ q/ @
$ g5 ]& [4 @' y7 W! s( p array( "name" => "</div></div>",
/ m. U# k( A, q' m4 [$ H& w1 h "type" => "close", P6 K3 `2 q4 i- m* V1 I, }+ v, g
),
& j1 E3 h4 _2 ?9 o4 A. M
* D; r9 W6 H, m' u/ |1 T7 {8 s) m ~& h1 F: `5 ?- I) W" y: e- z
array( "name" => "AddThis Social Bookmarking Settings"," z8 v! H9 z7 d
"type" => "heading",
- Z) V8 Z& M1 ~; X; v ),
8 P$ @2 l$ O1 y! E. v8 }& A
' {1 X, P! V" U9 \6 t array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>: U7 m! F" T" X6 U
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",8 H8 M$ ?" S# ^$ Z) m. F
"id" => $shortname."_addthis",
, i( w! N3 a: C# k2 C/ @* j "type" => "text",2 i b) s+ A9 V! N+ y) [0 F
"box" => "social",6 T. ^* U% B. x, C; f, X7 r& O$ w8 Q
"std" => "",
6 k9 s. v+ Z' @$ G7 b# q ),
& \% o' y# R: [% a! S! w! [
$ q1 o8 }7 m' o) d- N* W9 b% H array( "name" => "</div></div>"," J1 s; Y3 E! j) S" D( @$ w9 h: E! _
"type" => "close",
. ^% m& m( L6 ?& u" D. ` ),
* n# s- @% m/ t3 H, l) X9 f0 {1 E& E3 z ) A: H3 y4 X. |9 |* S+ H2 ]- p# {
* T# J" v1 ~! P3 p# H) H; @) K 3 j" ^+ l" V6 |3 y" ^3 ]' J& a
array( "name" => "YouTube Video Settings",
. B+ p7 D, m, o. h! f# {% j0 e "type" => "heading",
A0 T- i$ a8 r N/ @1 k+ g ),( A5 ^6 Y& A1 N$ t) W4 x
! i; b/ i1 m ?5 {) Q
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- a3 H# a. ?% c7 L" v
"id" => $shortname."_emvideo_activate",
% s$ S, Z" v5 }7 z3 @6 Q* n7 G% l "type" => "select",
8 {8 Y& s4 A+ E9 y) f$ ~ "std" => "No",! @ r2 _% E* F
"options" => array("No", "Yes")),
9 p+ t) [+ B9 C% l, J0 C+ X% @" D; f! v! `
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
9 `- L2 b% Y( S/ z$ z w "id" => $shortname."_emvideo",
& _$ m! ^3 O3 N( z( D' z "std" => "",
4 s- c9 H5 x2 g/ _/ |/ E "type" => "text"),
, B2 S4 ^, J4 M8 K' U& x) ]! O
/ C% J, n( u. f; X. ?( |( p array( "name" => "</div></div>",
3 Q( _& b4 N$ g$ R, J% Z, ] "type" => "close",- O+ y, a$ C/ D* r
),
, B W! ^! J* G3 B* U, U. l, z
3 ~1 V4 C; u6 ?, ^ array( "name" => "Twitter Settings",
: c/ `; _) x( r% t "type" => "heading",
+ z- K' r9 \# j ),
8 ]! F) [# v$ W) J+ A% t# c2 e6 ]/ ^' O! }, j2 j n# l# E4 y
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) ?) @' I( [* X5 v
"id" => $shortname."_twitter_activate",& m% s: R+ _- n s5 R. w' Q+ a
"type" => "select",
' L& V2 R3 [2 j3 n "std" => "No",
1 A: P$ B6 Y3 D7 A" i "options" => array("No", "Yes")),
9 j) o' w9 F, ~' C/ v/ b9 T# z7 c, M% M- C5 ~! G9 X
array( "name" => "Insert Your Twitter ID here* ^# V$ d( @/ K! G8 P5 {! M
<br /><em>*leave blank if not necessary</em>1 E& G5 M" X. N1 @6 _$ I- B* ~& _
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
0 \* W( Z- U# y& ^ d2 D- M5 {. j "id" => $shortname."_twitter",
, o& d4 @! g- O "type" => "text",6 {! M Z- \: u% C
"box" => "social",0 h# z- c( W) c4 C# ]
"std" => "",
0 N ?* d$ S5 B ),0 Y* k3 q) f# y
6 ?$ S% N& q5 k5 o
array( "name" => "Enter Twitter Feed Count here& v c$ d6 s% ?/ D
<br /><em>*leave blank if not necessary</em>
' x1 |6 ~! v3 o; r. x <br /><em>*Enter How Many Twitter Feed To Display</em>",1 p3 ?- p2 e" C- v
"id" => $shortname."_twitter_count",
5 ~! y& D+ s2 p" y: o, t "type" => "text",$ T. k' B; y% V/ e# Z; M6 t3 X
"box" => "social",$ d/ U, U: k" V2 D
"std" => "",
) p+ S( U% Z4 {- Y, I ),
1 U" v: x6 _* B
4 T2 A; T8 ?1 Y array( "name" => "</div></div>",
/ V2 l5 L' F% W9 b, W8 p" y "type" => "close",( o- E; h$ J' c4 u9 p
),7 h& p. h! K- l5 @
; R0 C; w1 n' z/ F
, X* K6 P" }- A G5 E
array( "name" => "125 x 125 Banners Advertisement Settings",
" w$ {$ w( Q" `9 c "type" => "heading",5 Y, H8 d/ t" o7 W* s n
),
+ ~$ J2 h- w* `9 U8 Y
) W* i9 i( u) n. X# i& W array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 Z8 R2 L4 j5 H4 o5 K% I& ^
"id" => $shortname."_sponsor_activate",6 i b( M& y5 V, t6 z( R- _8 w
"type" => "select",
) Q" r9 e' d- \) j "std" => "No",$ M( ~1 c2 \; k5 v; c' S) I; p
"options" => array("No", "Yes")),8 c* V) U# I. \6 F% b: d
- d" i. J6 j @& B( u! g
' Y) o) c+ j: j2 y. F4 ] array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",0 [& R+ ]' V( U! }
"id" => $shortname."_sponsor_banner_one",: O/ y+ N+ D7 t4 p
"type" => "textarea",1 m% f% ~0 ~* d0 b- _: o( J) |
"std" => "",
6 e6 G: j: @% J# | ),
: o# A: w$ C1 c. ^4 Q3 Y n/ I+ K( X0 G) Q, A" } g5 {
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",! C4 s7 Y m7 |' D. G- c5 n
"id" => $shortname."_sponsor_banner_two",$ Y1 t) |+ w; w8 E, ] D+ H8 O: q
"type" => "textarea",) z4 j8 I# h$ ?, V
"std" => "",1 f' X/ w, R+ z- [* A' m8 w, j
),
' V6 _1 }' B! }. h* P% H
) ]2 z q0 e1 O2 T6 V" E array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
. S( d# e) X! T) F% h "id" => $shortname."_sponsor_banner_three",0 D+ m& U) v' U) d- e/ q' d- R# L
"type" => "textarea",
! V3 [5 u" U4 Q" l/ ?& v' T "std" => "",( k+ k5 v2 d* s4 C! g, M
),+ Q2 N% V/ F8 [8 R$ O1 W, |
/ C) D0 N; A/ N7 v
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",: {% f9 q% ^* t+ n
"id" => $shortname."_sponsor_banner_four",
$ w' w4 r% Q# _5 s3 v, k! I5 i( r1 P "type" => "textarea",0 F3 N3 o& C/ g
"std" => "",. R: Z% g0 K8 ]. ?* q z, y& q
),0 m0 p: [$ r9 Q( O
c& x/ G4 x( w# i6 t array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",, C& \5 }/ X& r' P
"id" => $shortname."_sponsor_banner_five",
" d: i, D$ t3 M1 D8 M( k# P "type" => "textarea",
P" x6 V6 f ]- Q2 u "std" => "",* c+ N z1 |% o4 l1 ]
),- I; ]5 x: `3 c }7 p/ J
3 \3 L- d5 q, a$ C( \0 d. U P! Q
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
7 E7 E* U& O C# U0 Y* p c "id" => $shortname."_sponsor_banner_six"," l5 q1 z4 v: }+ L
"type" => "textarea",
- o0 O7 m3 R$ _1 `3 ] "std" => "",
" w, O4 r- O2 s q2 ? @ ),
. a" m$ l& Q! a m4 I0 Z) R7 u; u' c3 A
array( "name" => "</div></div>",% W/ a' l0 `) e/ Q4 t
"type" => "close",! ~# g5 p! v5 x* h* Z$ ]$ w
),
% _/ {4 m+ A6 G
7 r' E( y# `7 W4 o( p" `4 f( ]; N
2 F0 H! L$ y1 l9 z# K" h4 R+ V% l, l! {" I" U
);
" N/ _! h- W) C0 I8 k' y1 @: I; } P- A ]- `) B
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
! b3 J3 l& ~4 A7 P/ }
" e( z& L/ E0 g5 ^echo "<div id=\"admin-options\"> ";; g! P7 }/ @& c4 o
# {; {, b& F4 p- ]# h
global $themename, $shortname, $options;
2 b7 F5 Z9 W0 h2 Eif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';. q8 ?' F+ W6 z( r0 h
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
6 T$ `) \: D" B) r1 O?>! ^/ O+ N* p9 _, a; Y" j3 Y7 a
# o* B4 y- Q& _: T( s; V<h4><?php echo "$themename"; ?> Theme Options</h4>" { u0 N! l6 e; N) Z. x
; ?& F. G. e+ L# G4 ]( G<div class="annouce">: \8 u' C4 Q1 \6 b2 ] U- p
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
* i3 T4 X* X. ?' {<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
8 ^2 G7 c# o1 s9 u5 J$ I</div>! f/ _! c; w X
* R1 ^3 Y4 j& t {% w<form action="" method="post">
4 k9 T) l8 v0 x: w! _8 {2 I* X, `. v0 q0 V5 m
<?php foreach ($options as $value) { ?># `3 w3 B/ k$ N6 V. S% R- \0 a
6 g2 P& b7 c5 F) t8 T<?php switch ( $value['type'] ) { case 'heading': ?>5 C$ O- _ @7 Y; ?9 p; v4 B
2 @% L0 O4 b7 c
<div class="get-option">4 j1 w& i+ V+ l6 \( p. N
0 F8 u, [/ d& r. D
<h2><?php echo $value['name']; ?></h2>
* u9 U1 n1 g3 @, Q4 F
; V. G! i$ C1 F, R9 D2 W<div class="option-save">
% N8 F: D7 ^0 }% u0 n6 a
2 O6 ~- h1 H( J<?php
: W) r- v x- M- q0 R8 X, b# W' ubreak;' C. w# I: o* i0 ~; U
case 'text':) X& ], x4 C4 }& o" _* T+ G
?>
5 ? |2 `0 o1 O2 e9 b+ |# R$ i8 m1 s7 d* k1 j; F q
<div class="description"><?php echo $value['name']; ?></div>
# u' i4 o) L" A1 E6 ~, p<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (& s+ g, r T( |
; X8 u6 S* ?$ N) z c
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
1 |' M- p" ^- _, i a# }% M& t% S5 Z) B6 n- ^, f
<?php
7 n x7 L! Q: W) k3 H dbreak;
/ G6 n1 P# c- S3 ccase 'select':
' J2 b8 O" ?' j?>
' F* Q- D/ } v% {, d* ^
* ~( A2 a8 i( \<div class="description"><?php echo $value['name']; ?></div>
9 K+ {/ w4 u) _* z( Z# E" T4 ~! y2 @9 s<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
$ d7 B9 f0 K' |2 Y3 F, i$ a<?php foreach ($value['options'] as $option) { ?>
' I8 z7 U) q4 _<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>- D5 j% o2 G: j
<?php } ?>
3 L! B N6 l! s/ G5 @* k6 z& A</select>
/ C4 m6 y* p8 A' y</p>8 E( z0 b7 N. r1 Z0 u5 e( F8 s
5 X8 G5 {7 C* N0 w. d<?php
6 F" i/ B& {! w# j/ G& h; N: pbreak;8 R% R% ]7 N$ R% V' u( H* o
case 'textarea':
- C+ g9 o# e- C3 F7 |: u$valuex = $value['id'];, b' q. M6 Z8 `0 R
$valuey = stripslashes($valuex);0 D, L, S" |2 Z. H5 o* J8 ?( g5 K' a
$video_code = get_settings($valuey);
4 v( Y2 U' k. i?>
. c/ d3 F: `$ J) P1 ]; `: O+ n+ s* ]. V* p5 m, _
<div class="description"><?php echo $value['name']; ?></div>
6 W! y' O1 M& o, ]) ?<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
3 `- ~! e; @. ^6 u8 Y! A) e3 _4 |/ B
else { echo $value['std']; } ?></textarea></p>0 L* o4 }8 b' W* a1 n6 j4 ^- Z
' v# e( i, r. u0 @) U<?php' S, E0 p" r: G/ p% G& }
break;
; ]8 i8 g6 x8 rcase 'close':
8 x; l$ c* G5 w?>- S* Q/ `# x' M8 o" P/ W' G6 z
# G; u5 \$ |4 {/ D0 g8 ?<div class="clearfix"></div>' y1 T, {% D; f6 S6 B4 F
</div><!-- OPTION SAVE END -->% T8 Q% V+ R, Q$ P
3 l/ q+ ~. t" W& o
<div class="clearfix"></div>8 [+ q9 Q; G1 o
</div><!-- GET OPTION END -->
8 o( I2 _9 c7 R7 c/ l! L) R( n% ^ d7 p/ N: X- v q+ o
<?php) k8 h& n7 u6 J% g [0 U& z
break;
$ ]# y" u0 c6 w5 hdefault; M# a/ Q3 Q) v r" _
?>
. u7 O: C3 p8 H3 ? l0 U2 U5 n9 d* c
/ s; n1 v$ r( ~
: z5 j' N: l( j% ^) F1 ]0 K<?php& X* m9 Q% E, F1 A
break; } ?>7 K3 D( r) n7 g* y/ C
; |1 ?# M' }/ S% q<?php } ?>0 O/ j+ ]% o- W+ d2 ~9 Z
+ r# s9 g7 L2 g/ _<p class="save-p">4 J! E& Q, {6 j. a; }
<input name="save" type="submit" class="sbutton" value="Save Options" />
( K G* \- ^3 c" e<input type="hidden" name="action" value="save" />& g* }/ Q3 G" I
</p>; o, ^& h e2 S8 [. @/ _
</form>
# `! b9 r* Y) |- }
, B+ O: N- i* {<form method="post">
) i) {3 B" |* H" n% x<p class="save-p">
# h0 |% b7 A2 e( \. s8 X<input name="reset" type="submit" class="sbutton" value="Reset Options" />0 j% y, P0 M f3 _7 F
<input type="hidden" name="action" value="reset" />& T' p$ u2 E4 r$ b3 g, A. ^
</p>
/ [9 U, Z9 n$ m6 v ^</form>/ U1 x- [9 W) |' I$ o8 [
& E4 A" k. X$ Y L7 N5 w
</div><!-- ADMIN OPTIONS END -->
* h Y0 D( |) M) |- N# y# H. C) n6 k; V& E; K
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
" x( K. S3 Q# r& X* w5 l; U0 Y
" g/ a# D- d D9 dfunction mytheme_admin_register() {4 A$ z; e1 t/ W3 I7 d
global $themename, $shortname, $options;4 d4 n# {& U5 I. H/ v! `4 c9 {4 l' k
if ( $_GET['page'] == basename(__FILE__) ) {+ p/ @1 y% }( {5 ?) W1 r+ p0 W
if ( 'save' == $_REQUEST['action'] ) {
* C# o& n: _, T( w: H7 b/ w* R+ oforeach ($options as $value) { j" l$ n H( ^- h* d
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }7 o" O6 t% x0 r/ i" V
foreach ($options as $value) {; O3 d# o3 w# I/ C7 c) a
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
! l# ~) L4 H/ } K# x; yheader("Location: themes.php?page=functions.php&saved=true");
- _2 n% B5 m1 ^6 I- M3 r2 N \die;
3 |: m3 ^- Z" o: a1 v+ t5 I8 u} else if( 'reset' == $_REQUEST['action'] ) {8 X4 a8 k& e, N0 u* Z3 u6 |5 A5 f/ @
foreach ($options as $value) {% B$ J" t- ?% `
delete_option( $value['id'] ); }
7 q5 o+ j6 B( `( bheader("Location: themes.php?page=functions.php&reset=true");
5 r' E/ l6 C! _die;& g$ i2 _% s$ A' e d. s7 L+ L8 H0 b
}8 x& T: r1 @' o B: g
}/ v! |9 c6 W2 Y$ b' _( e
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
3 u- @9 y. w9 N) ?- r}4 _9 H* i T0 I7 [/ H8 m2 D: i
! f2 b3 C) C* t5 Q/ t$ q# u% {
function mytheme_admin_head() { ?>' u* K; Q: V+ g
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />. H5 \6 a+ e: z2 r& g' \
<?php }$ W) D' o8 m. S2 H9 b
|
|