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