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