|
|

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