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