|
|

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