|
|

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