|
|

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