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