|
|

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