|
|

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