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