|
|

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