|
|

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