|
|

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