|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////2 ]8 m9 p( H: |1 B4 T% Y
// Theme Option$ U/ `! C% F3 x2 H+ P8 F- h! V
////////////////////////////////////////////////////////////////////////////////
/ R) s/ |# S$ {+ A0 d! J" D
) _6 `& B5 _" |" {0 l' M' u2 j$themename = "Zenx";7 _7 o# e0 v) k' f) Q
$shortname = str_replace(' ', '_', strtolower($themename));/ {' G4 M3 I4 \' Z
) o# f$ m4 F7 `) ^6 H4 Wfunction get_theme_option($option)( x9 E& r: S7 W# J
{
" W% k" W# ` M7 ]/ N) S global $shortname;
: u& b( w4 O# e7 @ return stripslashes(get_option($shortname . '_' . $option));' |. E' i# ~% M2 r* F3 e0 N
}0 l! E* ~5 q$ j" Z* C8 f' l: r
! W4 r4 c% C6 o8 z" y. ^7 h) I
function get_theme_settings($option)
0 a) S8 ]1 W; t% N6 H4 _9 z{
+ @( W: ]( [4 s6 C4 [5 n return stripslashes(get_option($option));' v% @" v+ M& H7 _ j
}
0 I) c; m7 F9 F0 e2 K$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");
9 p* I5 S1 r; `8 H* b5 z' c% f$wp_getcat = array();
: C6 u0 I7 Q5 M8 ^- [& lforeach ($wp_dropdown_rd_admin as $category_list) {
. {7 v6 X" G' s& v) F3 s6 f$wp_getcat[$category_list->term_id] = $category_list->name;- i* U& ]( a" e K$ V
}2 [9 E$ P+ }# I9 [0 D* W9 r0 _
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");1 H# z, F: e( ?- s. z3 L. o
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");) ~/ ^+ x# F6 K& @
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");( b* z' T; W N: o) ]2 N. w( L
5 c9 _; m9 X2 _$options = array (
, o- n3 J2 |0 j4 Q' B4 J1 _
5 w/ A8 ?" B6 k& q% |+ w% G
4 x- a5 @" v" a* T array( "name" => "Blog Header Settings",8 P8 D! b4 V9 J: C6 E" q
"type" => "heading",8 N2 I% l2 `* y8 w% Q1 c& I
),( L$ E2 X2 l2 T$ ]) ]
1 N2 u: w) C0 q4 X, ^6 {8 c# `
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% V* L9 _& ^. W1 j3 j6 P2 T5 g$ A
"id" => $shortname."_header_logo_activate",
5 S: M% B/ h" W) _1 w/ j8 k "type" => "select",
- e5 D; J$ T9 W* {* P "std" => "No",, V+ X* | v; J& j6 X! h: ]
"options" => array("No", "Yes")),
* _* s8 [$ @, G0 `$ R' `0 ?' n* ]1 C
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",. [* [. |; j# c# k* j
"id" => $shortname."_logo_url",8 N, {* q9 z1 g+ v2 i
"type" => "text",
6 l$ Q8 U0 ?: {# |2 n) T "box" => "social",
- y& K! X3 c0 x4 P' U2 h "std" => "",
/ V t6 n( y/ A# N ),
- H3 d4 V! E' F
$ Z% `) v/ ~+ K. Y4 s array( "name" => "Insert Header Banner HTML Code (Header)9 k! Y! W6 P1 ]( i$ b2 a5 o6 L2 _
<br /><em>*Recommended Size 468 x 60</em>
. k4 X% W+ S6 ?) E1 V <br /><em>*leave blank if not use</em>",
- d8 n2 |% f) @ "id" => $shortname."_header_banner",
e. A9 |# n* I: [* M# b "type" => "textarea",. |- q: W5 }* K# O8 R, t
"std" => ""," w1 Q: W, p% j! o% G& Z6 F
),* ^$ `0 y) l0 K- C
! d2 V C% f# i# q9 \3 Q8 `: ] ~9 S
array( "name" => "</div></div>",& t$ K( [; m# P
"type" => "close",
, H* h6 b& l t3 {: D: O ),
6 b2 x- |$ I8 T. k2 B/ I+ |
$ t' l% N% { n( V$ G% O& O* O) v. I K8 p3 W( J$ ? P! T
array( "name" => "Header Navigation Settings",' d. J6 a+ T. R
"type" => "heading",
" k& A& b6 X* F* d, P w6 a1 t ),
2 A' j5 P6 z) G3 J6 g" |2 _
+ e5 \: A! U" N0 R array( "name" => "Insert Page ID To Exclude On Header Navigation<br />4 o* I' J0 h' D3 ^8 J! P/ H( b2 D* {
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br /> ^0 |8 j/ @; S- q
<em>*Enter the page post ID number only</em><br />
- }+ E: _* B b <em>*separate by comma</em><br />
% o8 P% p% z: t! o <em>*Exclude pages which you don't want to show on the header navigation</em>",
& }2 \8 z8 Q+ n) k, v3 m "id" => $shortname."_header_page_navigation",
+ R, T( H: t& X* |/ v+ [" A: P "type" => "text",: N2 o: l8 J+ t
"std" => "",
6 E' [: r' M6 I$ C/ a ),' g1 x* L- I) O0 E, y% c: y+ _7 i
( D0 ] F7 E. [3 a' w
array( "name" => "</div></div>",7 E% t+ T& [+ q, y) A1 F! @$ Y
"type" => "close"," r( S; z9 c# j( E( }2 J7 \
),6 N, O4 y+ x# y/ w- v( U% W0 Z0 k' E- L
" c5 t1 t5 {) j$ G
1 J9 E5 A5 R0 T" ]1 j array( "name" => "Post Auto Thumbnails Settings",8 s5 S/ g' K: |7 z
"type" => "heading",
, O! n8 `6 `. L. |7 M9 m ),
. a# U- `6 V) I, J
2 h' m0 t0 [% p8 N% _* q array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# f) |' i& `, u" l2 K2 |! f
"id" => $shortname."_timthumb_activate",& S( Y( L( D% F1 H! o' j9 X$ H
"type" => "select",
J# g/ @" C1 I( C+ A. x i4 T "std" => "No",
% G8 S- L- |) h o' [4 V3 v0 E- I "options" => array("No", "Yes")),. e- q: ]2 l9 I7 c
5 w% w6 x, S6 Z0 L% {
array( "name" => "If Timthumb is enabled, Please choose its cropping method",( w4 o: v9 U$ O" K$ \( Q$ Q0 ^5 Y
"id" => $shortname."_timthumb_cropping",
- s- R/ m9 Y8 E0 Y0 j# m "type" => "select",
1 @$ t2 O' l1 x# u5 a "std" => "",5 M6 s4 g) q1 @) G* `- g1 d
"options" => $crop_position)," q; O' v& h: `9 m v8 F
9 S/ O. j1 {% D' v" @
array( "name" => "Insert Width Of Thumbnail Image<br />6 |2 X. I8 q1 e! L; x8 \" f! W. `
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />2 O5 W5 w4 {* e2 n& i
<em>*Leave Blank To Use Default: 250</em><br />",- n8 e0 w4 a0 U% F E* O; B
"id" => $shortname."_thumb_width",
" \0 c6 l7 S1 A' l "type" => "text",, L) k9 l8 |# \" k( Y3 P& X i* y
"std" => "",4 h( `: [& x2 T5 r! O
),
( C2 x+ k, C0 @+ J. _! L* T2 W3 K" S% D+ O' E: }
array( "name" => "Insert Height Of Thumbnail Image<br />
$ y6 g4 J1 w8 Z. v <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ o1 F! B$ G/ B( b <em>*Leave Blank To Use Default: 200</em><br />",. m, C3 {7 H7 L3 U
"id" => $shortname."_thumb_height",
3 i" i& a! y0 y5 U. A5 v$ j "type" => "text",* r$ X" y0 Q# Z \ X/ z
"std" => "",' r" F) @* [6 F" _1 L" B
),& I5 I5 q4 u! L" f; }/ Q4 D. s: t
8 U0 {4 _# g* U. M
array( "name" => "</div></div>",
+ c: V% g/ |( t8 \4 u; H3 x "type" => "close",. J4 @$ ^0 a+ \2 ], J8 L, J
),
' R. u+ z- ^0 O D0 m$ R/ @
8 A! l6 S, g/ K, T! P0 b8 ~ array( "name" => "Featured Content Slider Settings",/ I4 p% J8 u$ D- k1 u
"type" => "heading",8 P0 ^/ _9 C4 U
),
" F' f" ?1 a1 Z0 M: ]0 v/ p# w! h: x7 G
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ l! @. O; f9 [4 e "id" => $shortname."_featured_activate",9 b7 t1 L. p) i
"type" => "select",
# N9 r( }. w& n: h& N" i$ x: b "std" => "No",5 V2 [4 V8 D! p
"options" => array("No", "Yes")),
- N/ _ D+ H* Z
0 `8 Z$ w$ a9 X M
' w6 V" l0 W1 Q7 y* i& e+ Y. B+ r array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",' W* u8 ?9 f9 y" Q! a" h
"id" => $shortname."_featured_category",
5 W) i+ Z1 \- d I# O "type" => "select",
' ]1 X9 k; x; w3 x1 N "std" => "Choose a category:",% V0 v8 _5 u: y6 J* [& ~
"options" => $wp_getcat),
- L5 g! ]* h d# D: E4 x
( P8 Q k- s# \: l array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
5 S/ a* X1 _; [4 j. c; Y N w "id" => $shortname."_featured_number",
~. u$ k7 S6 l+ L "type" => "select",
1 k' r: W0 d7 ~* o "std" => "Number of post:",# I5 w9 o1 U/ l$ V
"options" => $number_entries),& q3 ?- C) I2 J8 `; S/ [, |
0 h0 \8 ?6 i2 @: b1 m
array( "name" => "</div></div>",
$ P/ q+ q! ?2 Y# a "type" => "close",
/ k9 d; X! c5 S* ? ),
# {+ R) [1 x9 `2 U5 z! | : g& S% ?6 K+ k1 j2 S2 ] ^$ t
array( "name" => "Featured Category Settings",
2 Y; X: K1 J: }3 l: G7 J |/ [ "type" => "heading",7 P7 Y+ y: V0 \ i* H0 |* n% B
),
0 j% F4 _% A7 |* x; v1 |' Z" T- p3 b/ j# p, a
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. v4 M* s+ b3 h "id" => $shortname."_featured_category_activate",- \9 G4 ~$ `% v" K6 i0 Y! I0 _: }
"type" => "select",
% \/ a. \( ^% d) [9 v "std" => "No",
* B) b" o( X; u' A: C) ^ "options" => array("No", "Yes")),
, O1 u- M. \2 h% s* J" ?
) k# V1 ~7 e3 X. r3 u; J2 e8 O array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",, n/ _# C' f6 t. v6 t% i- }
"id" => $shortname."_featured_category_id1",
+ v/ R$ w$ j& o. W, ^$ K "type" => "select",4 i. c0 ?5 Z& }6 i
"std" => "Choose a category:",# o- E! m* e/ g5 m0 o
"options" => $wp_getcat),
/ ^/ a$ z. Q; {$ v
* O8 X6 s4 h) v; \# ^' Z. f array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",1 |9 a2 K2 \2 Q
"id" => $shortname."_featured_number1",
T' N1 C' t0 E: C "type" => "select",
0 E: O! A0 C) e. M8 D: O4 N7 ]% y: \ i, | "std" => "Number of post:",+ K! X2 ]& Z0 }8 f7 C% Q
"options" => $number_entries),* k( i# { S/ L# g/ j
1 N9 D- |7 B: g array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",% ^8 T* h1 G, L8 L
"id" => $shortname."_featured_category_id2",
3 Q& k2 g! m& A- v- h "type" => "select",
4 i( J) h N$ {2 {7 m "std" => "Choose a category:",3 @5 w$ b [0 m- P. d
"options" => $wp_getcat),
6 R5 s7 r8 B5 u6 q& m ! A. f9 v. e6 e* i
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",% O4 x: S: l6 x- j# p8 B
"id" => $shortname."_featured_number2",
4 N: {- U- a6 X- K l% }0 q "type" => "select",
, R5 x* u ~/ x, k( K1 h5 I. P* m "std" => "Number of post:", A* I% n% S$ {9 x
"options" => $number_entries),3 _' S- ^ c' u$ \% n
. H6 a! Y2 L& q6 o
& n- \4 N$ e: m% t' v& m4 e1 V& r6 y array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
J# Y6 R# M. X2 D2 M" s( C "id" => $shortname."_featured_category_id3",
0 P5 s I' \7 l2 q/ x$ j- A9 I "type" => "select",
! G. z& T3 y) a. n "std" => "Choose a category:",$ m5 ~! y+ ~) `
"options" => $wp_getcat),
+ w6 k/ M/ L+ z 1 F% F: p6 F5 t7 f* S
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
2 R+ g4 O& T* g& J- w7 Z$ ^) h' n6 Z "id" => $shortname."_featured_number3",
# z" n0 y# N+ x l9 C "type" => "select",7 X! T( n0 Y. M: q2 K4 P9 N
"std" => "Number of post:",
7 J1 y5 H& l* }$ J/ i% \/ l F "options" => $number_entries),
/ }8 w! I1 \9 U$ z4 j; O8 V$ p/ {; f( Q# g- i
$ e8 ^! u2 {$ f. x: e
array( "name" => "</div></div>",
% }. n; C9 P& }; W "type" => "close",
) T9 `2 u2 i" q& C' k ),
* j- k. F/ Y+ T; V& W" o. t% T C; n" E7 @) p [6 L
9 l" [3 u6 _4 h& l6 q" E array( "name" => "Google Adsense & Analytics Settings",
2 P4 ?* y4 g# |: Y+ C "type" => "heading",3 M7 h8 Y: u: l- F9 X9 B( Y1 R' d
),
' K* ~# M" C1 d9 U& M( z$ T4 I9 Y# @) B
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",0 J, |# o" M" f3 D: c9 s' h, }
"id" => $shortname."_adsense_loop_activate",
% ]4 ^: ~+ x" _5 ?$ I "type" => "select",
8 ^* G+ m* G- M" J9 @ "std" => "Disable",
3 c/ T7 G" v3 p* U( V, m( R& B "options" => array("Disable", "Enable")),
g. e% ^: t! v
0 K! h! w! b8 Q, E I array( "name" => "Insert Google Adsense Code For Loops Here<br />
+ Q5 O7 }3 P3 B. r& F" O1 q3 G <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
' n* R" z1 r+ j! e2 @8 k" p "id" => $shortname."_adsense_loop",. k# A6 _& ]+ [/ K* Y: k, ~
"type" => "textarea",
- J# N3 C' _. ]( T "std" => "",1 ^9 t2 Q5 I% a' G3 \
),# a3 n0 Y7 J9 o7 x
# F+ f- R4 X) Q1 W+ C
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",# @+ j* a. `. ?- s
"id" => $shortname."_adsense_single_activate",
6 k7 U: L% Q2 ^ F( g) u3 i "type" => "select",# ^. W/ d& b! ?
"std" => "Disable",
. D% s a. B4 Q. l) p. N8 P "options" => array("Disable", "Enable")),) C: J) x; E' ^2 O
8 r. z7 \! m/ X5 o" M/ J, E array( "name" => "Insert Google Adsense Code For Single Page Here<br />
* K" R2 B- e5 f) `& J" F0 @ s <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",3 X" T, z2 z2 @3 b+ T
"id" => $shortname."_adsense_single",& K; F4 `5 c0 `/ B, h. {' [7 b( C
"type" => "textarea",4 u' J& m) P4 w0 j
"std" => "",
0 B a; C$ W: C+ j6 q! k( R- r% W ),' b; Y# ]! Q& K6 f, S
$ `7 w( G$ I8 b" i7 d3 x! f
* E0 c5 ?" ]! V8 W% U
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
0 N3 |' p/ f0 o# @( _ "id" => $shortname."_google_analytics",) I& O5 W; B/ \+ e
"type" => "textarea",
' Z- c- q% M6 L1 [2 j2 o6 F* s "std" => "",1 H* V. ~ j; f( o/ k
),
/ S7 u" B$ L m' Q/ Z* v$ J5 G0 W' K* ~
array( "name" => "</div></div>",( @; l& j# E- D! [$ ?
"type" => "close",
1 H$ w4 @& h! C3 D* Y0 s ),
0 E' p( F( k O5 r1 K* I1 [7 B
- w# \6 W; s1 L0 Z ! F9 h, p! C. s( A# }4 t; S8 y
array( "name" => "AddThis Social Bookmarking Settings",
0 ~: X6 e1 a5 v$ M1 f: h "type" => "heading",
+ c/ k2 j8 h) k$ \1 f$ i ),
. ]# @3 G. Z+ E: \/ i! p* C9 @" K1 K2 c' [8 |
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>' b. O% X: n4 S: S$ f- Z
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",; @, ^9 _3 F b9 S# D8 `
"id" => $shortname."_addthis",
+ ~8 Y3 [7 j) u' c! P- J/ _ "type" => "text",+ Q! g n: m1 E
"box" => "social",
& o# G- m* o) L! y7 I7 W, T) G4 y1 Z "std" => "",
: C6 H3 ~7 s" v e v ),! q" z! p7 |( o, i% Z) M/ T
2 ]# s$ D" \. n: S+ l# g1 y
array( "name" => "</div></div>",
- O# r" `3 y( \) \9 u, s. n+ R "type" => "close",; E; s5 Z4 Z- t
),
7 s0 M; h, p# r/ a+ p6 ^ 3 z' _! c9 y9 M0 F+ T3 f
/ z7 ~% }% E+ K, B/ w+ s+ ]
1 Y- W$ g# J3 U+ }: n+ Q: P3 } array( "name" => "YouTube Video Settings",# X; ~9 Q+ {- b4 e
"type" => "heading",
, z0 |6 t0 \ W2 e) Y ),
/ |* L4 v" b4 r; y) N5 O1 ?
, v! _ ?+ L8 j6 E array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 } q8 f+ n, y6 B8 i
"id" => $shortname."_emvideo_activate",/ H: Q1 H. [6 D6 j& t' f4 s
"type" => "select",
& l# {0 i: P4 d( g: m1 n4 D3 G# a4 [ "std" => "No",2 f1 X: a# h0 a% A4 f/ V$ G: K
"options" => array("No", "Yes")),( o3 E/ Y+ c+ v) m k
$ A. w& B/ W2 [4 e# I 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>",: Y; m9 O& B4 s& `+ y* X% m
"id" => $shortname."_emvideo",
8 _ V2 u( l- q; U' N$ M: i( |# g "std" => "",
! q( C, A! L2 }4 h# o$ h2 | "type" => "text"),. U t/ N7 p$ g1 }" S
. b- \3 N3 f' |& `) [9 U
array( "name" => "</div></div>",
5 g% D5 L4 x1 `( L" [: S: P% x3 T "type" => "close",
( g" v" y4 U* W& a ),
1 M$ J8 u/ ^4 E. o1 i' q0 m
3 k% b% z! f& I# \9 E! Y5 D array( "name" => "Twitter Settings",
& N( e4 ]8 J. O7 W$ ^2 T "type" => "heading"," T8 m# ]# @( d4 n7 D5 @) V9 Z) R& G
),
7 R6 r$ i/ Q0 Y
4 m( z5 y6 y% k; w array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 x* X( {, R/ N. N "id" => $shortname."_twitter_activate",3 o* Z( K& B2 m
"type" => "select",
' o) n; A7 _1 t/ D "std" => "No", X( |4 k. q) B0 z7 i
"options" => array("No", "Yes")),
3 w( }9 m' o h: O
# S9 z) {0 U9 o array( "name" => "Insert Your Twitter ID here
A8 k5 M4 w% o% I% Q( y. Y <br /><em>*leave blank if not necessary</em>) E5 O1 p6 f, J8 L/ e) W: s
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",9 Q$ E2 g1 U$ e$ O+ |+ y- T U
"id" => $shortname."_twitter",2 n5 P4 ?0 e' H1 ^) N& G/ Z9 U+ d/ g* M; b
"type" => "text",
' G% G- Y* U- T/ ~6 A" W- S "box" => "social",
5 w3 r/ o' h8 y. s "std" => "",
$ m' _* ~; a) s' h9 l# _3 D ), D6 r( N$ K) G2 B7 | L$ T7 ~
! b+ K W. q# T6 I: ?1 a& ^ array( "name" => "Enter Twitter Feed Count here1 ^; I' {8 P5 |& V, x
<br /><em>*leave blank if not necessary</em>
# }/ g7 P# p- u5 k; e+ L <br /><em>*Enter How Many Twitter Feed To Display</em>"," d( W* _: z' [ q4 \
"id" => $shortname."_twitter_count",- l1 o+ k' s# `
"type" => "text",
: d$ n$ g' Y+ g7 ^. X "box" => "social",
: ~6 q. s( F# l/ E: g "std" => "",1 l% N$ x3 V/ d4 p5 ^3 Q) L
),
" H6 }1 m1 c$ {3 u; ]1 a$ l
: I/ _0 K( M; x9 M8 T array( "name" => "</div></div>",
- j( X. w/ t. P$ B& R" s: N* B "type" => "close",
, I+ g9 M7 s4 B ),! ~4 q( C# b' F1 Q
: \( g! \9 x7 J1 e8 m8 b" u
, e% p& c( d( ~1 n array( "name" => "125 x 125 Banners Advertisement Settings",2 C Q# ~8 A% b+ V' L- H% S
"type" => "heading",
; J4 P3 F& u S) a4 @ ),
" Q1 J2 `# @; l' W - }2 ?6 g' i; f
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; h; g' y' z2 H
"id" => $shortname."_sponsor_activate",
' l# C. v q' z, _/ k( s' A/ s$ P- Q "type" => "select",
: y7 A: ]1 o; w6 A "std" => "No",3 ?' P7 U* K+ v2 ]! i2 k" n
"options" => array("No", "Yes")),
" l. z0 T7 P! g z i6 o # A0 Q% D+ e; T+ Q. l8 _
$ ^% _4 }! f4 C% T3 P0 s) ?% i array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",$ S1 F7 B4 t3 G" R
"id" => $shortname."_sponsor_banner_one",
& v5 x) L; ?% p V) z) P5 ] "type" => "textarea",& j3 h) D8 @, C, s
"std" => "",
* \) t6 z% u/ M# U ), . ^. e3 _! q7 i# i% p& M
4 ^# |9 f4 J0 l
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",% e+ j9 S M" P0 o; Q+ \
"id" => $shortname."_sponsor_banner_two",3 c9 l9 b* `9 j; _# x; {- @. a5 O
"type" => "textarea",$ C6 A; n C; \
"std" => "",
# x% w( n9 H& P7 v9 r0 x. }5 d ),
; ]2 F/ j2 }% s- N9 v7 | \ [- M9 \# A* x$ l! H
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",5 H7 P0 _. U* n; d, k
"id" => $shortname."_sponsor_banner_three",
& i1 ^* y: m3 d; i "type" => "textarea",4 \; v8 B- s2 C) l
"std" => "",
V$ O# O, n" k: a5 P- C ),
3 |6 a* k8 Y( i8 R% e3 `
5 L( ^6 T4 J4 T$ j8 x0 m3 x4 ? array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
( f: E* G/ H" y% l. D3 G "id" => $shortname."_sponsor_banner_four",$ ^; V; m* X9 P" y
"type" => "textarea",2 o& z# ~3 O6 n9 t* p p) Q) V
"std" => "",
0 o0 _5 X- o, L; v4 h. W1 s; P ),1 \4 Y% ^' s+ r* L
& ?9 H8 g- [. S. g array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
" y( e5 F# M; q Q- k6 K "id" => $shortname."_sponsor_banner_five",
! S$ Z* }! c. F. B "type" => "textarea",
! r* s& A( Q* b9 v5 F "std" => "",0 t1 w: n! H6 p) ]: Q. j
),
2 }! W8 |" Z" G1 H
- {! U; Z- N2 r. U array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
, S0 R V1 ^. a. x+ A: T "id" => $shortname."_sponsor_banner_six",' F0 Z% f0 `' M& x
"type" => "textarea",
T! P# C# h- Y0 r: i6 F! }# Q "std" => "",
! q. v* ~$ s6 v# k* V ),
; ~% ?: U) {% |3 ` P/ ? |% B- t3 l- ?
$ K4 x/ ?1 K: z; s0 F3 J array( "name" => "</div></div>",
( M) l* b: D2 v1 x6 ? "type" => "close",
5 J9 a% P' s$ s+ U ),# E+ a& M3 o* }) T! g, w; _3 I
4 u) t9 A3 R3 N% q. A: a
1 \4 {; J( O1 [0 g% i1 U s' o7 e( J+ z5 {2 f A; h0 _ L
);
7 A3 g; y% f# [1 L4 T% L1 w& P4 q& k; ?) y1 U/ o
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {, z; ^( K- g3 Q3 E0 V+ v' n
% ~, p- f* n) A t( l1 fecho "<div id=\"admin-options\"> ";
, j: q7 y' W. K2 q/ x
+ G3 D: e9 {6 s% Cglobal $themename, $shortname, $options;0 X3 V- u' \, c. b
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';( R2 G- W7 y5 X# b- F) m
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';+ Q* P6 a$ B" Z
?>0 _4 O; J3 o0 a( f0 e
* I1 N, j' k) R( t* k4 D" S: e6 h
<h4><?php echo "$themename"; ?> Theme Options</h4>3 U5 {( q# l( M( m
; a* \( {+ f% w/ M# U<div class="annouce">9 @2 U/ B2 S4 y+ Y/ @
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
1 ~! d6 O; n4 u; k# }. ?1 @<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>
0 T! [ t4 F9 b ?, }' E+ E</div>
4 _2 O/ t8 m! Y* N6 ^$ A. X9 i( F, {
' f1 a) k) |% D; Y( t5 \4 Q<form action="" method="post">
) i4 ?; i4 b2 h$ ]: |! r8 L& j7 H4 X" {
<?php foreach ($options as $value) { ?>6 s p; H# N" t) w* G
' p" H) U" j4 ^! `
<?php switch ( $value['type'] ) { case 'heading': ?>1 s; s: Q# }) T& E3 C1 Y
6 f! {- S7 G; o6 I$ |8 P
<div class="get-option">
$ l+ w, E7 w2 L* g+ ?: r
2 {, C: K- ^! s0 ? V$ I0 B. y<h2><?php echo $value['name']; ?></h2>
. r: Z5 e% O0 |, V5 w% v/ L3 `: ]" }! J* X" J8 _9 D
<div class="option-save">3 b, h" K" H" B! o+ p* v2 F
! i/ _6 E. @, s6 q; P<?php
* ^- u. ], f6 M* obreak;
r. Y: D) B0 f; lcase 'text':
( G1 ? b) K" N8 [?>0 Q3 [$ R: e, n8 W8 [% y
! W$ R) f D( g
<div class="description"><?php echo $value['name']; ?></div>
+ K C* E. K. x4 F<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (, ]+ |) g. Y+ m) i/ b
$ q3 [& w+ f. ~" _# P# D- b! S
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
* O* p7 n3 U: Y& |' \3 b# p( b
, a& a, _" c9 Q/ O7 X& P# U<?php6 L5 x L' D1 G
break;. @# p/ u& S. |8 r
case 'select':
* d" |. h/ ]! V* a8 a8 p# _?>; O2 z) |' D9 D5 f' a7 x
0 r0 V/ _; h8 d, Q
<div class="description"><?php echo $value['name']; ?></div>
8 t' R! e. a p. ^0 S+ b, Q<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">( T* U3 A" U9 x$ h; k
<?php foreach ($value['options'] as $option) { ?>
& C$ a* t# g0 o/ v9 `5 s<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
. x0 z. d: u6 C; f' g! A1 N<?php } ?>0 w" g, f: T0 ~" a( |& ]* v
</select>
0 Q" o8 a. t: Z' }2 s</p>2 T, X; m) K' V
; k ?1 ^# f! A* G# \7 l/ y- p% h: K6 L<?php
( V8 k8 K* K$ e. z# g# Q' ubreak;2 K/ w0 y% h) b
case 'textarea':9 w% J( X: E1 K) A( f
$valuex = $value['id'];
& W2 g4 V2 E' v/ s; f' N) t$valuey = stripslashes($valuex);
! A+ m( p9 i8 v& \( C* X% C6 S$video_code = get_settings($valuey);5 M. Z8 [3 H* }1 l
?>7 a) ~7 _. B2 c$ n% t. s
, U4 ~ z# E2 ^& T" Q
<div class="description"><?php echo $value['name']; ?></div>
" H9 G) C+ A7 E6 j0 y9 X3 W<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
, v, _) `7 o( ~3 F! m Y' J
- X2 I9 H1 S8 w" selse { echo $value['std']; } ?></textarea></p>
: Y2 s. E5 G3 v) J5 t" n+ R3 b0 \, D' L5 x6 h( N) q) S
<?php
! i" |1 j8 `( L* W+ l# qbreak;
3 A5 y0 d8 X+ I! H4 q( q( vcase 'close':
. {( @% Y3 e2 A) y7 X?>
5 L+ e/ L8 F$ q
% s9 _! t9 B# |# k<div class="clearfix"></div>4 l* n6 _0 a$ [7 u2 B
</div><!-- OPTION SAVE END -->
" W) C* K! ?, b
) v, {/ ^# W( `7 Q$ s) d* c<div class="clearfix"></div>3 g( D- V( r0 C+ E' Y
</div><!-- GET OPTION END -->
/ H# G; J% R, P8 `! A. W. w3 f- J/ h4 b
<?php
; A- \2 W9 [- W2 T' C' Bbreak;
% }+ q" X6 D: G( o5 Adefault;1 l; S" x8 B. j. B/ R
?>$ f. l8 V) x- x4 N, Y" @$ {2 @
+ s2 v& m" N( i# W7 ?
$ U3 h" Y/ ~; D* m3 I<?php6 F% l: H+ N; }, E' @
break; } ?>8 J C3 }1 M) w c, @) Z' ?
! ]3 r5 Y. D7 l4 Q4 v e: O; [<?php } ?>
# H1 n. y- w2 w8 D& b% H2 F5 k
<p class="save-p">9 V& F: K: j: k& ^
<input name="save" type="submit" class="sbutton" value="Save Options" />0 i8 u0 e' O$ W7 {( T9 t
<input type="hidden" name="action" value="save" />: D6 i: I% A: O' T" ?* D
</p>5 P( N7 }: r; y0 _2 r6 K
</form>. X" n' \# z" ]1 f' Q
3 A! C; s9 a- v1 H) q; `8 e<form method="post">
) r! Q6 ~9 D( E4 {4 f<p class="save-p"> E n$ D) \1 G% q! [8 {1 I: o
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
d+ z |3 J) T$ |<input type="hidden" name="action" value="reset" />/ ~& W- w! u& _1 R
</p>$ @: ?8 g2 }- _, M* H( P
</form>
6 y/ j8 ]' O7 Q" a G8 j% H. V+ i. _' Z
</div><!-- ADMIN OPTIONS END -->: ?4 @, }( d- b. A9 L. C: i6 a; g
8 |5 a0 L% W; R+ g$ x+ x
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
, w, e* x$ A" |7 ?1 v
3 }, e+ ]% a. |. wfunction mytheme_admin_register() {
9 _7 L! i1 |* M1 c$ [6 p, Kglobal $themename, $shortname, $options;
& o% ?# _/ p8 N$ a* y7 ?if ( $_GET['page'] == basename(__FILE__) ) {( K+ ?$ I8 y6 y h
if ( 'save' == $_REQUEST['action'] ) {# L( {5 w4 P0 } E4 O
foreach ($options as $value) {$ A5 I" L( v) ? V" M+ c
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }7 n8 H, w% e/ p) z. g
foreach ($options as $value) {
9 Q6 a8 i) ^4 c. {; C" B5 ^: r3 nif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
/ H! P- U* _% R' C5 d& k, yheader("Location: themes.php?page=functions.php&saved=true");
) N# x: f0 `$ P: i# r2 ^die;
/ \' q0 |% K" S3 A4 H8 W D} else if( 'reset' == $_REQUEST['action'] ) {8 @& Z9 C4 u3 M2 y) M# `- Y2 B
foreach ($options as $value) {1 @5 L |& N) c- }5 \
delete_option( $value['id'] ); }
) J/ h4 ]' u2 \1 ^# K) K% H( K1 xheader("Location: themes.php?page=functions.php&reset=true");
4 ]& y( G) g7 o( d) h& kdie;
+ R$ g& x5 C2 C}" V8 Y1 w8 ~; _* v- d8 y
}
' s4 x3 x0 q: `& x2 t+ ]$ Y( Uadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
1 V$ w8 \& N8 c& d$ G( _( k u/ T}
/ K- w6 q0 ~' f- Z3 w/ C
% ~! q' |- S; \4 Ofunction mytheme_admin_head() { ?># ]" ?2 q3 @9 k
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
; w0 Y7 t# P8 ^% |9 \<?php }
) S( C' M2 y# W7 B& B |
|